2 column, 2 query loops, adding pagination
-
Hello all,
I have some searching for a solution to my problem here, I have found a few articles and threads that are sniffing around the solution, I’m having trouble pulling it all together though.
I want to create a pagination menu on the homepage that has 2 custom query loops. I’m using the following code to call the 1st column of posts:
<?php $recentPosts = new WP_Query(); $recentPosts->query('showposts=8orderby=date'); while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?>
and the following code to call second column of posts:
<?php $recentPosts = new WP_Query(); $recentPosts->query('showposts=8&offset=8'); while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?>
When I use wordpress’s own pagination and PagNavi plugin the query is just repeated so only the first 16 posts in the loop will be displayed regardless of using the pagination menu.
What modifications do I need to make to this query so when a request is made for the 2nd ‘page’ of news stories WP knows to move onto the next 16 posts and not repeat the same most recent 16.
The site where this code is running is live at : LOCWS International
If I have omitted anything here, please let me know and I will hopefully be able to shed some light on it. Thanks for your time and help.
Lawrence
- The topic ‘2 column, 2 query loops, adding pagination’ is closed to new replies.