I am using a large number of custom taxonomies. My post type is called “location” and there is a parent term “Asia” and a subterm “Thailand”.

Now I created the taxonomy archive template files according to the WordPress Codex, which is working in the following format:

taxonomy-location-Thailand.php (see codex for taxonomy-$taxonomy-$term.php)

After that my permalinks will look like following:

  • www.mysite.com/location/thailand

As Thailand is a subterm of Asia, I need the parent term also included, like following:

  • www.mysite.com/location/asia/thailand

Anybody knows how to include a redirect for all subterms to have their parent terms included in the permalinks?

As I am having a large number of taxonomies, I need this working in one function, and not seperated for each single term.

Read more here: Rewrite rules for subterms in custom taxonomies


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , , ,

Wordpress related questions and answers: