I have more than one loop in the same page and they are working perfectly, but the problem comes up when I try to use next_posts_link & previous_posts_link for a specific div.


<div id="example1"><div id="next1"><?php next_posts_link('<img src="'.get_template_directory_uri().'/images/next.jpg" />'); ?></div>
<div id="previous1"><?php previous_posts_link('<img src="'.get_template_directory_uri().'/images/previous.jpg" />'); ?></div></div>

When I click on next or previous for a specific div, why do all the other divs that contain next_posts_link & previous_posts_link get updated also?


Have you tried wp_reset_query(); after each loop?

Please provide complete code for your template then we may can help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.