Quantcast
Channel: polylang – WordPress.org Forums
Viewing all articles
Browse latest Browse all 11471

brunodario on "[Plugin: Polylang] Get all top level category IDs from a given language?"

$
0
0

Latest version is installed (1.5.4) by the time of this post
your permalinks settings
month / name

if you are using a static front page
No, regular post page

your Polylang settings

    Portuguese and English languages
    The language is set from the directory name in pretty permalinks
    Remove /language/ in pretty permalinks

I 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);
	}
};

https://wordpress.org/plugins/polylang/


Viewing all articles
Browse latest Browse all 11471

Trending Articles