Support » Fixing WordPress » Help With Pagination – search results – not refreshing content

  • The Pagination is being added to the bottom of the search results page and the number of pages does change depending on what search term I use. But if you click the next button or select a page number the url changes but the search results don’t, it just continues to display the first 10 results.

    Does anyone know how I could fix this?

    Here’s my code:

    [Code moderated as per the Forum Rules. Please use the pastebin]

Viewing 7 replies - 1 through 7 (of 7 total)
  • As a guess, the query is not using the ‘paged’ variable. Since I can’t see your code, it is hard to be specific, but it might be something like this:

    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    global $wp_query;
          array('paged' => $paged),

    I’m not sure where I should be adding what you’ve added…

    This is my code:

    Any Suggestions would be a BIG Help!

    Add the code I posted just ahead of the ‘if (have_posts())’ line.

    All I’m getting is a blank page when I insert your code. Thoughts?

    Please post the first 15 lines of the code with the inserted bit.

    did pasting that code resolve the issue? I’m having the same problem where clicking on page 2 only just shows the first results again and like to know if this resolved your issue and if not what did. also, what php page did you paste the code, search.php?


    Where you put the code depends on your theme. It must be in the template that is displaying the results that you want paginated. Determine which template is used and modify it. BACK UP FIRST!!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Help With Pagination – search results – not refreshing content’ is closed to new replies.