Get all top level category IDs from a given language?
-
Latest version is installed (1.5.4) by the time of this post
your permalinks settings
month / nameif you are using a static front page
No, regular post pageyour Polylang settings
- Portuguese and English languages
The language is set from the directory name in pretty permalinks
Remove /language/ in pretty permalinksI wonder if there’s a way to get all top level categories IDs from a given language. I know how to get all top level categories IDs but i’d like to do something like this:
For each language get all top level categories ID as an array, so i would end up with something like this (i’ve hardcoded it so far):
if (function_exists('pll_current_language')) { $ovv_idioma = pll_current_language(); if($ovv_idioma == 'en' ) { $link_categoria = array(32,36,31,30,35,33,40,34); } else if($ovv_idioma == 'pt' ) { $link_categoria = array(16,18,20,24,22,26,38,28); } };
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Get all top level category IDs from a given language?’ is closed to new replies.