Limiting Category Counts in the Loop (4 posts)

  1. misterpatrick67
    Posted 6 years ago #

    Hello all,

    I have a home page that I currently have post counts set to 15. Problem is, specific categories are getting many more postings than others. Is there a way to limit specific categories to say 3 most recent posts, thus letting other categories maintain a presence on the home page? Not quite sure what the approach would be. Thanks!

  2. MichaelH
    Posted 6 years ago #

  3. misterpatrick67
    Posted 6 years ago #

    Thanks for the tip! I'll take a look and see how they are coding that. If anyone has any loop tips, those would be great as well as I prefer to not rely on plug-ins. Thanks!

  4. MichaelH
    Posted 6 years ago #

    Example of proper pagination:

    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts('cat=3&posts_per_page='.get_option('posts_per_page').'&paged=' . $paged);

    See the WordPress Default theme's wp-content/themes/default/index.php for example of using the template tags, previous_posts_link() and next_posts_link().

    Stepping Into Template Tags
    Stepping Into Templates
    Template Hierarchy

Topic Closed

This topic has been closed to new replies.

About this Topic