WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Current Best Practices for separating posts (via category) onto different pages (3 posts)

  1. kpolkson
    Member
    Posted 1 year ago #

    Hello everyone. I did some digging around, but am still confused or not totally complete on my understanding of the current best practices for filtering posts with certain categories to certain pages (an unlimited number of times).

    I say unlimited simply because I see a lot of talk in the support here about filtering the home page down to a certain category of posts, but I was hoping for more of a quick explanation of what would be the best way to, say, create two or three more pages (other than the home page) filtering to each only posts that have three different, corresponding pages. For example, I would create pages 'Daily Doings' and 'Sports' and would only show posts on 'Daily Doings' categorized with 'Daily' and for 'Sports' only posts with the 'Sports' category. Just to illustrate.

    I am not afraid of the PHP and assume the best practice involves creating new templates for each page (?) and then exluding or including the exact categories there (?)

    please let me know if there is a better way to do this.

    thanks.
    k

  2. Slobodan Manic
    Member
    Posted 1 year ago #

    You could also create only one custom page template and have a custom field in it whose value would be either category slug or ID. Then you could have a WP_Query in that page template and use custom field value to get posts from that category (or those categories).

    But if what you want to do is always show posts from one category in one page, much better to just use category template.

  3. kpolkson
    Member
    Posted 1 year ago #

    ok, that makes sense. thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic