Title: query_posts question
Last modified: August 18, 2016

---

# query_posts question

 *  [ubersoft](https://wordpress.org/support/users/ubersoft/)
 * (@ubersoft)
 * [20 years, 1 month ago](https://wordpress.org/support/topic/query_posts-question/)
 * I’ve very recently set up my index page to use two loops. The first uses query_posts
   to display only categories 2, 3 and 4, the second to display only categories 
   1, 5 and 6.
 * This part works fine.
 * What I want to do, though is also set up the query_posts for each to do the following:
 *  – the first loop will show all of the posts made for a single day
 *  – the second loop will show the last five posts made, regardless of the date
   they were posted
 * How can I do this? I’ve tried setting wordpress to “show at most 1 days”, then
   using posts_per_page=5 as a variable in the query_posts for the second loop, 
   but that winds up showing every post made in the last five *days*.
 * Any ideas?

Viewing 1 replies (of 1 total)

 *  Thread Starter [ubersoft](https://wordpress.org/support/users/ubersoft/)
 * (@ubersoft)
 * [20 years, 1 month ago](https://wordpress.org/support/topic/query_posts-question/#post-385072)
 * Another problem I’ve found is that when I have two loops running on the index
   page, it’s not possible to use posts_nav_link — you can set it up, but accessing
   past pages continues to show the front page data you’ve established in both loops
   with query_posts…
 * … tricky.

Viewing 1 replies (of 1 total)

The topic ‘query_posts question’ is closed to new replies.

## Tags

 * [loop](https://wordpress.org/support/topic-tag/loop/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [ubersoft](https://wordpress.org/support/users/ubersoft/)
 * Last activity: [20 years, 1 month ago](https://wordpress.org/support/topic/query_posts-question/#post-385072)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
