Polylang functions in functions.php
-
Hi (once again),
I would like to dynamicaly affect custom fields to each translated post of a current post. The idea is to set an array of every pages in french and to affect the location of the custom fields with every translations id.
How can I get the translations id in my must-use plugin OR in functions.php ?
Polylang functions seems to be declared (if( function_exists… is good) but return anything…
This does’nt work :
global $idLangs; $myFrenchId = '1696'; global $polylang; if(isset($polylang)){ foreach ($polylang->get_languages_list() as $term){ $idLangs = pll_get_post($myFrenchId, $term->slug); } } print_r($idLangs);
Thanks for any answer, any idea… ^^
Viewing 13 replies - 1 through 13 (of 13 total)
Viewing 13 replies - 1 through 13 (of 13 total)
- The topic ‘Polylang functions in functions.php’ is closed to new replies.