Translated category id differs from original, ‘child_of’ will not work as filter
-
Hi everyone.
Might be simple but then… i am using categories for to filter exhibitions on a yearly base, ie one category is 2018, one is 2019 etc. in a multisite install where i have two languages going (de & en using multisite for this).
When i translate a category with Multi Site Language Switcher a new category gets created within the other site/language and this newly created category has a different id than the original category.
I checked the always available category ‘General’ which comes from the core system and, checking the database, found that they both have the category id of ‘1’, for english (‘General’) and for german (‘Allgemein’). So ‘child_of’ in the function ‘wp_list_categories’ will work in both languages when set to ‘1’ and display all sub categories.
But it will not work set to any id in the original language that belongs to a year because the translated category, even if it has the same name, has a different id and the translated page will show zero results because ‘child-of’ points to the wrong id (the id of the oringinal category of the translated category).
How can one get around this? Messing with the db is no option. Has to be dynamic. Maybe it’s just late. Thanks for any input.
- The topic ‘Translated category id differs from original, ‘child_of’ will not work as filter’ is closed to new replies.