Note that there are some explanatory texts on larger screens.

plurals
  1. POWordpress Search Result Pagination - not refreshing content
    primarykey
    data
    text
    <p>I'm trying to add pagination to my wordpress search results.</p> <p>I was able to locate some information on how to do this - <a href="http://codex.wordpress.org/Function_Reference/paginate_links" rel="nofollow">http://codex.wordpress.org/Function_Reference/paginate_links</a></p> <p>But I've run into a problem that I can't explain.</p> <p>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. If you click the next button or select a page number the url changes but the search results don't...</p> <p>I'm only able to have the first 10 result appear on the page, even if I click page 4, the page will refresh but it still displaying the original 10 results.</p> <p>Does anyone know how I could fix this?</p> <p>Here's my code</p> <pre><code>&lt;?php get_header(); iinclude_page(608); ?&gt; &lt;li id="search"&gt; &lt;form id="searchform" method="get" action="&lt;?php bloginfo('home'); ?&gt;"&gt; &lt;div style="text-align:center; margin:20px 0 25px 0;"&gt; &lt;label style="font-weight:bold;" for="s"&gt;&lt;?php _e('Search Database:'); ?&gt;&lt;/label&gt; &lt;input type="text" name="s" id="s" size="20" /&gt; &lt;?php $args = array('hide_empty'=&gt;0,'depth'=&gt;2,'hierarchical'=&gt; 1, ); wp_dropdown_categories($args); ?&gt; &lt;input type="submit" value="&lt;?php _e('Search'); ?&gt;" /&gt; &lt;/div&gt; &lt;/form&gt; &lt;/li&gt; &lt;hr /&gt; &lt;?php if (have_posts()): ?&gt; &lt;?php while (have_posts()) : the_post(); ?&gt; &lt;li class="postWrapper" id="post-&lt;?php the_ID(); ?&gt;"&gt; &lt;h3 class="entry-title"&gt;&lt;a href="&lt;?php the_permalink() ?&gt;" rel="bookmark"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h3&gt; &lt;div id="postdata"&gt; &lt;div class="search-content"&gt; &lt;?php the_excerpt(__('&lt;p&gt;Read More &gt;&lt;/p&gt;')); ?&gt; &lt;/div&gt; &lt;div class="entry-meta"&gt; &lt;?php $view_in_browser = '&lt;a class="google-viewer" href="http://docs.google.com/viewer?url='.$attachment_url.'"&gt;View document in browser&lt;/a&gt;'; $download = '&lt;a class="download" href="'.$attachment_url.'"&gt;Download PDF&lt;/a&gt;'; echo $view_in_browser . '&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;' . $download; ?&gt; &lt;/div&gt; &lt;/div&gt; &lt;hr /&gt; &lt;/li&gt; &lt;?php endwhile; ?&gt; &lt;?php global $wp_rewrite; $wp_query-&gt;query_vars['paged'] &gt; 1 ? $current = $wp_query-&gt;query_vars['paged'] : $current = 1; $pagination = array( 'base' =&gt; @add_query_arg('page','%#%'), 'format' =&gt; '', 'total' =&gt; $wp_query-&gt;max_num_pages, 'current' =&gt; $current, 'show_all' =&gt; true, 'type' =&gt; 'plain', ); if( $wp_rewrite-&gt;using_permalinks() ) $pagination['base'] = user_trailingslashit( trailingslashit( remove_query_arg('s',get_pagenum_link(1) ) ) . 'page/%#%/', 'paged'); if( !empty($wp_query-&gt;query_vars['s']) ) $pagination['add_args'] = array('s'=&gt;get_query_var('s')); echo paginate_links($pagination); ?&gt; &lt;?php else: ?&gt; &lt;h3 style="text-align:center; font-weight:bold; color:#333;"&gt;&lt;?php _e('Sorry, no posts matched your criteria.'); ?&gt;&lt;/h3&gt; &lt;p style="text-align:center"&gt;Please try Searching anohter term.&lt;/p&gt; &lt;?php endif; ?&gt; &lt;?php if (will_paginate()): ?&gt; &lt;?php endif; ?&gt; &lt;?php get_footer(); ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload