B
B
Bogdan2018-09-05 17:06:14
WordPress
Bogdan, 2018-09-05 17:06:14

Taxonomy file?

Don't tell me how to do it right.
I have 3 types of taxonomies (categ, fashion, covering)
and when switching to a taxonomy like categ/metal, fashion/modern... I need to style posts.
How can I create 3 files with the same content taxonomy-fashion.php, taxonomy-categ.php, taxonomy-covering.php and there is also a separate page where you need these posts to be displayed there, but maybe there is a better solution that would be all taxonomies that refer to a specific type of post through one file do?
Thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly, 2018-09-05
@bogdan_uman

if (
    is_tax('fashion') ||
    is_tax('covering')
)
    get_template_part('taxonomy-file');

This is in the taxonomy.php file, then for yourself, I think the essence is clear.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question