• jonathantopf

    (@jonathantopf)


    hey there, is there a way to get different amount of posts per page for separate categories? actually i only need a way of showing all the posts when i choose a certain category. I assume ther eis some code i need to put in to the loop for that categorys page, i just cant figure out what

    thanks

Viewing 1 replies (of 1 total)
  • stvwlf

    (@stvwlf)

    hi – you can add a query_posts command in an if statement before the loop in category.php

    <?php if(is_category('7')) {
       query_posts('posts_per_page=5');
    } else if(is_category('9')) {
       query_posts('posts_per_page=3');
    }

    Any categories not in your list would show the default # of posts per page.

    =========== loop starts here =============

    take a look at the query_posts codes page
    https://codex.www.ads-software.com/Template_Tags/query_posts

Viewing 1 replies (of 1 total)
  • The topic ‘different posts per page for categorys’ is closed to new replies.