WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. jbeswick
    Member
    Posted 1 year 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
    Member
    Posted 1 year ago #

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

  3. p5systems
    Member
    Posted 1 year ago #

    <?php
    query_posts('cat=17&posts_per_page=3');
    while (have_posts()) : the_post();
    the_title();
    the_content();
    endwhile;
    ?>

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

    thanks
    P5systems

  4. jbeswick
    Member
    Posted 1 year ago #

    Very useful, p5systems - thanks very much.

  5. Celeste1212
    Member
    Posted 1 year 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
    Forum Moderator
    Posted 1 year ago #

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

  7. Celeste1212
    Member
    Posted 1 year ago #

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

    [Closed]

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags

No tags yet.