Link to home
Start Free TrialLog in
Avatar of Refael
RefaelFlag for United States of America

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?
Avatar of Ovid Burke
Ovid Burke
Flag of Saint Vincent and the Grenadines image

You can refer to the accepted answer in this thread for a possible solution: https://www.experts-exchange.com/questions/27729949/add-meta-box-to-select-category-to-select-on-custom-blog-page-in-wordpress.html

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.
Avatar of Refael

ASKER

Hi madaboutasp,

This basically require me to hard-code the category name unless that i get all the categories on one page.
ASKER CERTIFIED SOLUTION
Avatar of Ovid Burke
Ovid Burke
Flag of Saint Vincent and the Grenadines image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Refael

ASKER

Thank you.