Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to create separate pagination for mutiple loops?
    primarykey
    data
    text
    <p>I have created two loops with pagination (first loop loops through <b>CAT'S</b> category and second loops through <b>DOG'S</b> category), but now I am stuck:( <br/><br/><b>The problem:</b> After I click "Next entry" on my site (<b>CAT'S</b> category) it goes to second entry in that category <b>BUT it also</b> goes to my <b>DOG'S</b> category second entry (<b>I don't want THAT!! </b>). It also happens vice versa...</p> <p>What I like to do is this: I click on "Next Entry" on my <b>CAT'S</b> category and it goes <b>only</b> to next post in <b>THAT category (CAT'S)</b> but <b>NOT</b> to second post in my <b>DOG'S</b> category, or another way around: I click on "Next Entry" on my <b>DOG'S</b> category and it goes <b>only</b> to next post in <b>THAT category (DOG'S)</b> but <b>NOT</b> to second post in my <b>CAT'S</b> category . <br/><br/>Can someone help me please? I have asked for help on <a href="https://wordpress.stackexchange.com/">wordpress.stackexchange.com</a> a while ago but I didn't get any answer so I am asking question here. </p> <p>Index php looks like this:</p> <pre><code>&lt;?php get_header(); ?&gt; &lt;?php get_sidebar(); ?&gt; &lt;div id="blog"&gt; &lt;?php $args = array( 'category_name' =&gt; 'cats' ); $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $the_query = new WP_query($args . '&amp;paged=' . $paged . '&amp;cat=-3'); while( $the_query -&gt; have_posts()) : $the_query -&gt; the_post(); ?&gt; &lt;div class="post"&gt; &lt;div class="post_title"&gt; &lt;h3&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h3&gt; &lt;/div&gt; &lt;div class="entry"&gt; &lt;?php the_post_thumbnail(); ?&gt; &lt;?php the_content('Read on...'); ?&gt; &lt;p class="postmetadata"&gt; &lt;?php _e('Filed under&amp;#58;'); ?&gt; &lt;?php the_category(', ') ?&gt; &lt;?php _e('by'); ?&gt; &lt;?php the_author(); ?&gt;&lt;br /&gt; &lt;?php comments_popup_link('No Comments &amp;#187;', '1 Comment &amp;#187;', '% Comments &amp;#187;'); ?&gt; &lt;?php edit_post_link('Edit', ' &amp;#124; ', ''); ?&gt; &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;?php endwhile;?&gt; &lt;?php wp_reset_postdata();?&gt; &lt;div class="navigation"&gt; &lt;div style="float:left;" class="alignleft"&gt;&lt;?php previous_posts_link('&amp;laquo; Previous Entries') ?&gt;&lt;/div&gt; &lt;div style="float:right;" class="alignright"&gt;&lt;?php next_posts_link('Next Entries &amp;raquo;',$the_query-&gt;max_num_pages) ?&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="blogs"&gt; &lt;?php $args = array( 'category_name' =&gt; 'dogs' ); $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $the_query = new WP_query($args . '&amp;paged=' . $paged . '&amp;cat=-10'); while( $the_query -&gt; have_posts()) : $the_query -&gt; the_post(); ?&gt; &lt;div class="post"&gt; &lt;div class="post_title"&gt; &lt;h3&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h3&gt; &lt;/div&gt; &lt;div class="entry"&gt; &lt;?php the_post_thumbnail(); ?&gt; &lt;?php the_content('Read on...'); ?&gt; &lt;p class="postmetadata"&gt; &lt;?php _e('Filed under&amp;#58;'); ?&gt; &lt;?php the_category(', ') ?&gt; &lt;?php _e('by'); ?&gt; &lt;?php the_author(); ?&gt;&lt;br /&gt; &lt;?php comments_popup_link('No Comments &amp;#187;', '1 Comment &amp;#187;', '% Comments &amp;#187;'); ?&gt; &lt;?php edit_post_link('Edit', ' &amp;#124; ', ''); ?&gt; &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;?php endwhile;?&gt; &lt;?php wp_reset_postdata();?&gt; &lt;div class="navigation"&gt; &lt;div style="float:left;" class="alignleft"&gt;&lt;?php previous_posts_link('&amp;laquo; Previous Entries') ?&gt;&lt;/div&gt; &lt;div style="float:right;" class="alignright"&gt;&lt;?php next_posts_link('Next Entries &amp;raquo;',$the_query-&gt;max_num_pages) ?&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;?php get_footer(); ?&gt; </code></pre>
    singulars
    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.
 

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