Note that there are some explanatory texts on larger screens.

plurals
  1. POWordpress custom post template page/2 loop not working
    primarykey
    data
    text
    <p>I have a loop in the sidebar of a custom template and it works perfectly when the page is loaded. The page is -</p> <p><a href="http://ere.doneready.com/senior-consultants" rel="nofollow">http://ere.doneready.com/senior-consultants</a></p> <p>However the loop (which shows the list of names) does not work when I click the "next" button i.e. this page -</p> <p><a href="http://ere.doneready.com/senior-consultants/page/2/" rel="nofollow">http://ere.doneready.com/senior-consultants/page/2/</a></p> <p>Can anyone help? The following is the code I use - </p> <pre><code> &lt;div id="people-sidebar-content"&gt; &lt;div id="custom-search-form-for-people"&gt; &lt;form method="get" id="searchform" action="&lt;?php echo esc_url( home_url( '/' ) ); ?&gt;"&gt; &lt;div id="custom-search-form-label"&gt;&lt;label for="s" class="assistive-text"&gt;&lt;?php _e( 'SEARCH' ); ?&gt;&lt;/label&gt;&lt;/div&gt; &lt;span id="search-box-box"&gt;&lt;input class="search-box" type="text" name="s" id="s" /&gt;&lt;/span&gt; &lt;span id="search-box-button"&gt;&lt;input type="image" name="submit" id="searchsubmit" SRC="http://www.doneready.com/ere/wp-content/themes/ere/images/search_button.png" HEIGHT="17" WIDTH="20" BORDER="0" ALT="Submit Form"&gt;&lt;/span&gt; &lt;/form&gt; &lt;/div&gt; &lt;div id="people-sidebar-content-usable" class="senior-consultants-active"&gt; &lt;div id="sidebar-for-people"&gt; &lt;a class="directors" href="http:/www.ere.doneready.com/directors/"&gt;Directors&lt;/a&gt;&lt;br /&gt; &lt;a class="finance-admin" href="http:/www.ere.doneready.com/finance-and-admin/"&gt;Finance &amp; Admin&lt;/a&gt;&lt;br /&gt; &lt;a class="senior-consultants" href="http:/www.ere.doneready.com/senior-consultants/"&gt;Senior Consultants&lt;/a&gt;&lt;br /&gt; &lt;div id="actual-people-list"&gt; &lt;?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args=array( 'post_type'=&gt;'staff', 'posts_per_page' =&gt; 99, 'paged'=&gt;$paged, 'staff_categories'=&gt;'Senior Consultants' ); $temp1 = $wp_query; $wp_query= null; $wp_query = new WP_Query($args); if ( $wp_query-&gt;have_posts() ) : while ( $wp_query-&gt;have_posts() ) : $wp_query-&gt;the_post(); ?&gt; &lt;div class="actual-people-list-single"&gt; &lt;a href ="&lt;?php the_permalink(); ?&gt;"&gt; &lt;?php echo esc_html( get_post_meta( get_the_ID(), 'staff_short_name', true ) ); ?&gt; &lt;/a&gt; &lt;/div&gt; &lt;?php endwhile; endif; /* PageNavi at Bottom */ $wp_query = null; $wp_query = $temp1; wp_reset_query(); ?&gt; &lt;/div&gt; &lt;a class="consultants" href="http:/www.ere.doneready.com/consultants/"&gt;Consultants&lt;/a&gt;&lt;br /&gt; &lt;a class="technical-support" href="http:/www.ere.doneready.com/technical-support/"&gt;Technical Support&lt;/a&gt; &lt;/div&gt; &lt;/div&gt;&lt;!--END PEOPLE-SIDEBAR-CONTENT-USABLE--&gt; &lt;/div&gt;&lt;!--END PEOPLE-SIDEBAR-CONTENT--&gt; &lt;/div&gt;&lt;!--END CONTENT CONTAINER--&gt; &lt;/div&gt;&lt;!--END PAGE-WRAP--&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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