some templates are chosen from WordPress based on slugs (e.g. category-{slug}.php
).
Problem:
How can I use the same template for an i18n’ed slug?
Example:
I have a category-news.php
and an english category with slug “news” and german category with slug “nachrichten”. But of course “nachrichten” doesn’t get category-news.php
as a template. How can I i18n “nachrichten” so WordPress knows it means “news” before the template will be chosen internally?
Filter
template_include
:But I think templates based on slugs are not a good idea in that case.