Quantcast
Viewing all articles
Browse latest Browse all 11471

Chouby on "[Plugin: Polylang] Translating Custom Post Type & Taxonomy Slugs"

You can try to add the following code in a custom plugin or in the functions.php of your theme. This will work only if you add the language code to all urls.

add_filter('option_category_base', 'pll_category_base');
function pll_category_base($option) {
	if (is_admin())
		pll_register_string('category_base', $option);
	else
		$option = pll__($option);
	return $option;
}

Then you type your original slug as category base in the permalinks panel, and translate it in the strings translation panel.


Viewing all articles
Browse latest Browse all 11471

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>