Refael
asked on
WordPress post category per page
Hello experts,
In wordpress let’s say I have page name “fashion” (e.g. mydomain.com/fashion) and a page name “art” e.g. (e.g. mydomain.com/art).
These pages have one template (the page template).
I want that all the posts that is categorized “fashion” to display in the fashion page and all the posts categorized “art” to display in the art page.
Now, I can make a template per page and then hard-code the post category name to display but I would like to have one template for all the pages and then let it know the category it should display.
Is this possible?
In wordpress let’s say I have page name “fashion” (e.g. mydomain.com/fashion) and a page name “art” e.g. (e.g. mydomain.com/art).
These pages have one template (the page template).
I want that all the posts that is categorized “fashion” to display in the fashion page and all the posts categorized “art” to display in the art page.
Now, I can make a template per page and then hard-code the post category name to display but I would like to have one template for all the pages and then let it know the category it should display.
Is this possible?
ASKER
Hi madaboutasp,
This basically require me to hard-code the category name unless that i get all the categories on one page.
This basically require me to hard-code the category name unless that i get all the categories on one page.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you.
The general idea is to assign a Category to your pages, the code you page.php (or other desired template) to handle post based on that assigned category.