[resolved] posts_nav_link keeps showing same posts (3 posts)

  1. snaushads
    Posted 3 years ago #

    I have a Page, with Custom Page Template to display 6 "Posts" from a specific category on that page.

    The Code that i have used can be found here: http://pastebin.com/E52u0TTi

    Also, i have tried below solution which appears to be for the same issue:

    <div class="navigation">
    <div class="alignleft"><?php previous_posts_link('&laquo; Previous Entries') ?></div>
    <div class="alignright"><?php next_posts_link('Next Entries &raquo;','') ?></div>

    But Both show same posts and not other posts, however the URL changes to page/1/ page/2 and so on.

    What do i intend to have:

    I want to have Next link to be displayed on the template and when it is clicked, the next set of Posts with same Category should load.

    I tried to google for a solution can stumbled upon this , the solution used here is deprecated.

    Kindly help.

  2. Michael
    Forum Moderator
    Posted 3 years ago #

    a: you need to add the 'paged' parameter into the custom query;
    b: you need to add the custom query information to the next/prev_posts_inks;



  3. snaushads
    Posted 3 years ago #

    @alchymyth, Thanks a lot for help, the solution works.

Topic Closed

This topic has been closed to new replies.

About this Topic