WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] post navigation not working with custom loop (7 posts)

  1. christian_gnoth
    Member
    Posted 4 years ago #

    hello,
    I am using query_post to get posts and below the post list I am showing the next and previous post links.
    But those links are not working - I am always getting the same result from query_post - even if I give the $query_string as parameter.

    how I can show on a page selected posts and the navigation through is working?

  2. Edouard Duplessis
    Member
    Posted 4 years ago #

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

    Pagination Parameters

    • nopaging=true - will disable pagination, displaying all posts
    • posts_per_page=10 - number of posts to show per page
    • paged=2 - show the posts that would normally show up just on page 2 when using the "Older Entries" link. You should set this to get_query_var( 'paged' ) if you want your query to work with pagination.
    • order=ASC - show posts in chronological order, DESC to show in reverse order (the default)
  3. christian_gnoth
    Member
    Posted 4 years ago #

    ok, I found it too and it is working, but on my single posts the links are no links only text.

    see: http://wp-theme-t1.it-gnoth.de/2010/07/21/test-artikel-for-delman/

  4. Edouard Duplessis
    Member
    Posted 4 years ago #

    did you put the previous and next link inside the custom query??

    Because you have too...

    <?php
        $myloops = new Wp_query();
        if($myloops->have_posts()){
            while($myloops->have_posts(){
                $myloops->the_post();
            }
        posts_nav_link();
        }
    ?>
  5. christian_gnoth
    Member
    Posted 4 years ago #

    it is just a single.php - it happens with all single post views. no idea at the moment.

  6. christian_gnoth
    Member
    Posted 4 years ago #

    ok I solved the problem - thanks for the help

  7. bondjack
    Member
    Posted 4 years ago #

    Christian, now did you solve this? Please share your code, thx

Topic Closed

This topic has been closed to new replies.

About this Topic