Answer the question
In order to leave comments, you need to log in
How to properly organize WordPress templates?
Greetings.
I'm making a topic from scratch (well, more precisely, I'm copying more, but I'm trying to do it meaningfully)
Introductory:
Added via register_post_type 2 types: porfolio,
service like I understand how to use the hierarchy of templates.
In the reading section, it says: "On the main page, display - Your latest entries." Those. the main one works as if according to the template "archive-post.php" (I don't have it now, so it's just "index.php")
------------
Questions:
1) I want to make 4 pages each of which will display 1 out of 4 post_type.
For example: a portfolio page with taxonomies added to it and the actual records of this type.
How to make such a page: for now I only imagine it as a static page (i.e. post_type=page), which, through the page-$slug.php template, make a separate file and get post_type=portfolio through WP_Query,
but it seems to me that this some kind of game (most likely it is)
2) I made archive-portfolio.php and how to use it? single-portfolio.php - works when I go to the portfolio page, similar to taxonomy-portfolio_tag.php - works fine on the right pages. And what should be in the address bar for archive-portfolio.php to work?
Answer the question
In order to leave comments, you need to log in
Weird. I even saw here the advice to re-save in the permalink settings, I did it, but nothing changed. And then after the next time it worked as it should.
In general, the specific issue was resolved. But if someone will have advice after reading - I will be grateful
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question