I find the explanation here very useful : http://codex.wordpress.org/The_Loop#Multiple_Loops
, except it doesn’t tell me how to get pagination for multiple loops. I read some similar questions here too, but they are either not answered or doesn’t really work. Below are the codes I use for two different custom loops:
$myLoop1 = new WP_Query("tag='myTag1'&showposts=5"&paged=" . $paged );
while($myLoop1->have_posts()) : $myLoop1->the_post();
//do something...
endwhile;
$myLoop2 = new WP_Query("tag='myTag2'&showposts=5"&paged=" . $paged );
while($myLoop2->have_posts()) : $myLoop2->the_post();
//do something...
endwhile;
The tutorial here: http://www.kriesi.at/archives/how-to-build-a-wordpress-post-pagination-without-plugin/ should be able to get the pagination done smoothly, but I tried many many times, it never work. The link of page is always www.myDomain.com/page/# which is a general page address instead of my custom loop.
Moreover, is it possible to ajaxify the pagination so visitors can go to different pages of the loops while staying on the page? This is minor, the first question is much more important to me. Thanks in advance!
Finally I found the solution thanks to @brasofilo ‘s advice! The answer from the following link allow you to have as many custom loops as you want all in the same page!
https://wordpress.stackexchange.com/questions/47259/multiple-wp-query-loops-with-pagination
p.s. If anyone has ajax solution, I would love to know!