WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Query posts pagination - How to tell if there's more pages and link to them? (3 posts)

  1. jeremyduffy
    Member
    Posted 5 years ago #

    I'm very close to finally finishing this page, but there's one last thing that eludes me. I have a crazy query_posts call that includes all the various categories, and ids etc and of course I remembered to include paged=$_GET[paged] (not exact, but you get the idea).

    Here's the thing. When I print the results of the "query_posts" function using "while have post, the post" etc, how do I know if there are more results and, therefore, that I need to print a "next" button? Is there an auto function for that and, if not, does something query_posts return tell me?

  2. MichaelH
    Member
    Posted 5 years ago #

    How about $wp_query->max_num_pages to use for total pages in that query and get_next_posts_link?

  3. jeremyduffy
    Member
    Posted 5 years ago #

    U = my hero

    I can't use next_post_link due to my implementation it seems, but using the total number of results, I can do that part manually. It will probably end up better if I do actually since I can do a numbered series of page numbers like google.

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic