Forums

[resolved] previous and next pages (5 posts)

  1. sanypoo
    Member
    Posted 1 year ago #

    Hi,

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

  2. James
    Happiness Engineer
    Posted 1 year ago #

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

  3. sanypoo
    Member
    Posted 1 year ago #

    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..

  4. alchymyth
    The Sweeper
    Posted 1 year ago #

    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);

    http://codex.wordpress.org/Function_Reference/query_posts#Pagination_Parameters

  5. sanypoo
    Member
    Posted 1 year ago #

    thank you.. it's working.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags