Answer the question
In order to leave comments, you need to log in
How to force a template to be included in taxonomy pages?
Hello friend, I need your help! Let's figure it out together!
I have a custom taxonomy called => 'taxonomy_for_catalog' for a custom post type => 'type_catalog'
I have a catalog page that has the latest posts of the 'type_catalog' type mentioned above.
This is how this page .ru/catalog looks like:
If you go to any of these posts, my template single-type_catalog.php works:
It would seem, what else is needed for happiness? After all, something is already working, and it is already worth a lot. Let's delve even one level lower:
The link for posts of the type_catalog type looks like this:
But if you go to any section from the menu of the .ru/catalog page, the link of which includes the name of the taxonomy itself:
It redirects me to index.php, which of course does not suit me, as well as my customer.
There have been countless attempts to create template files for this taxonomy with different names, such as:
category-taxonomy_for_catalog.php
archive-taxonomy_for_catalog.php
page-taxonomy_for_catalog.php
taxonomy_for_catalog.php
in the admin panel by self-selecting a template for the newborn taxonomy_for_catalog page with the taxonomy_for_catalog label. Lacking originality from birth, the name of the selected template is the same as the page tag - taxonomy_for_catalog.
Please, kind people, tell me how to make the taxonomy template work? It feels like index.php is holding my templates hostage!
Answer the question
In order to leave comments, you need to log in
Update the "Permalinks" item, it might help. Make all your templates and update this item.
Already asked on the Toaster a million times, and answered too. See my answer here - https://toster.ru/answer?answer_id=1346897
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question