• Resolved sanypoo

    (@sanypoo)


    Hi,

    I want to display only 4 post per page… the remaining should go to next pages… any help . how to solve this

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator James Huff

    (@macmanx)

    Go to Settings/Reading in your admin panel and enter “4” where it says “Blog pages show at most [x] posts”.

    Thread Starter sanypoo

    (@sanypoo)

    Thanks for your reply…..

    I used
    query_posts(‘posts_per_page=4&category_name=’.$category->cat_name);
    It’s displaying 4 post… I want to display the remaining posts in next pages… but clicking the next button, its should display the remaining post…. I used

    <div class=”morebg”>
    <div class=”morebgcontainleft”>
    <?php posts_nav_link(”,”,’« Previous Entries’) ?>
    </div>
    <div class=”morebgcontainright”>
    <?php posts_nav_link(”,’Next Entries »’,”) ?>
    </div>
    </div>

    Its going to next category posts disply… pls help me to solve this..

    try to expand your query line with the paged parameter:

    query_posts('posts_per_page=4&category_name='.$category->cat_name);

    so it looks like this:

    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts('posts_per_page=4&category_name='.$category->cat_name . '&paged=' . $paged);

    https://codex.www.ads-software.com/Function_Reference/query_posts#Pagination_Parameters

    Thread Starter sanypoo

    (@sanypoo)

    thank you.. it’s working.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘previous and next pages’ is closed to new replies.