List categories through a template page
-
Hi everyone,
In the navigation bar there is a menu that opens a page template (custom) for each item.
Meanwhile the sub-pages (which will also be customized) are “default template”, but I want to click on them (sub-pages) to
open up the contents as if they were showing post per category.the site is https://www.caxiasdigital.com.br.
I have included a page template as an example in Notícias => Local / Estado and another in Vida => Pessoas & EventosI thought of two solutions.
1 – I want to make the item from the sub-menu navigation bar (which are “default template”), when clicked, open up a page with only posts from that category.
I have no idea how to make this association2 – Create a “template page” with a function that satisfacts of all sub-pages.
That is:
-identifies which sub-page was clicked, it would be “get_page_template”?
-makes a wp_query passing the parameter of her name (since the structure of pages and sub-pages are almost identical to the categories and sub-categories);
-posts the list in this category.I did this and didn’t work
[Code moderated as per the Forum Rules. Please use the pastebin or post smaller code snippets inside backticks.]
Thanks
Fernando
- The topic ‘List categories through a template page’ is closed to new replies.