[resolved] [closed] How to show only one category of media posts per page (7 posts)

  1. jbeswick
    Posted 3 years ago #

    When I create a page and set the Template to any of the portfolio types, is it possible to restrict the posts that are shown based upon category?

    The use case is that we have three pages where we want to use the "Portfolio" template but each one needs to show posts from different categories.

    Many thanks in advance for your help!

  2. betsywade
    Posted 3 years ago #

    I second this question - I would like to know too!

  3. p5systems
    Posted 3 years ago #

    while (have_posts()) : the_post();

    you can use this for restrict ing the categories. just you need to pass your category id and limit the posts per page.


  4. jbeswick
    Posted 3 years ago #

    Very useful, p5systems - thanks very much.

  5. Celeste1212
    Posted 3 years ago #

    p5systems, I'm sorry, I'm not quite understanding your answer because I'm still learning my way around WP.

    For example, I want three different Portfolio pages: Video, Photography, and Ebooks. Video portfolio is for category "videos," Photography portfolio is for category "photos," and Ebooks portfolio is for category "books." Let's say portfolio page for video is ID #123, for photography it is ID #456, and for ebooks it is ID #789.

    How would I modify your code example for the Video portfolio page? If I see how it's done for a specific page and parameters, then the other two would be easy to figure out.

    Also, do I insert the code into the Custom CSS in Theme Options, or do I insert it elsewhere, perhaps a child theme?

    Pinboard is a great theme, and I'd love to be able to customize it just a little bit more. Thank you :)

  6. Andrew Nevins
    Forum moderator
    Posted 3 years ago #

    Celeste1212, if you need further support than that provided in this thread, please create your own thread.

  7. Celeste1212
    Posted 3 years ago #

    Okay, but it seemed like a logical continuation. I'll post another thread later, thanks.


Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic


No tags yet.