• Hello,
    When I search something i default search field and get results, I cannot switch between pages.
    Nothing happens when I click on page number or next button. Only addres is changing (but page is not reloading) for ex:
    /?s=szpital&searchsubmit=U#038;searchsubmit=U&paged=1
    /?s=szpital&searchsubmit=U#038;searchsubmit=U&paged=2
    etc..
    I’m using 2.0.0

Viewing 2 replies - 1 through 2 (of 2 total)
  • Theme Author TT Themes

    (@tomastoman)

    Hi,

    which permalinks structure are you using please? Does the problem occur if you switch to a different permalinks structure? If you are using a custom permalinks structure, it might help if you edit the following code in “search.php”:

    echo paginate_links( array(
    	'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
    	'format' => '?paged=%#%',
    	'current' => max( 1, get_query_var('paged') ),
      'prev_text' => __( '← Previous', 'happenstance' ),
    	'next_text' => __( 'Next →', 'happenstance' ),
    	'total' => $wp_query->max_num_pages,
      'add_args' => false
    ) );

    in this way:

    echo paginate_links( array(
    	'format' => '?paged=%#%',
    	'current' => max( 1, get_query_var('paged') ),
      'prev_text' => __( '← Previous', 'happenstance' ),
    	'next_text' => __( 'Next →', 'happenstance' ),
    	'total' => $wp_query->max_num_pages,
      'add_args' => false
    ) );

    I am going to remove the “base” argument in a future update as it is no longer necessary in the latest WordPress version, but it might break the URL addresses of search results with some permalinks structures.

    Best regards,
    Tomas Toman

    Thread Starter theSpid3r

    (@thespid3r)

    Now everything’s working great. Thank you very much!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Cannot switch pages in search results’ is closed to new replies.