Title: Query Posts
Last modified: August 18, 2016

---

# Query Posts

 *  [freddymungo](https://wordpress.org/support/users/freddymungo/)
 * (@freddymungo)
 * [19 years, 11 months ago](https://wordpress.org/support/topic/query-posts-2/)
 * I want to use query_posts on single pages to only query the last five posts in
   the category my post is in– so it changes between photos in different categories.
   How do I go about doing this?
 * EDIT: Actually, either that or display five random photos from the category my
   post is in would work too. Any ideas?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [google_earth](https://wordpress.org/support/users/google_earth/)
 * (@google_earth)
 * [19 years, 10 months ago](https://wordpress.org/support/topic/query-posts-2/#post-384359)
 * There is a good random posts plugin which can be restricted to the category you
   are in, this might meet your needs.
 * See Customizable Post Listings
    Plugin URI: [http://www.coffee2code.com/wp-plugins/](http://www.coffee2code.com/wp-plugins/)
 *  [geoffe](https://wordpress.org/support/users/geoffe/)
 * (@geoffe)
 * [19 years, 10 months ago](https://wordpress.org/support/topic/query-posts-2/#post-384360)
 * Here’s a good [Random Posts Plugin](http://www.skippy.net/blog/2004/05/27/random-posts/).

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Query Posts’ is closed to new replies.

## Tags

 * [posts](https://wordpress.org/support/topic-tag/posts/)
 * [query](https://wordpress.org/support/topic-tag/query/)
 * [single](https://wordpress.org/support/topic-tag/single/)
 * [specific](https://wordpress.org/support/topic-tag/specific/)

 * 2 replies
 * 3 participants
 * Last reply from: [geoffe](https://wordpress.org/support/users/geoffe/)
 * Last activity: [19 years, 10 months ago](https://wordpress.org/support/topic/query-posts-2/#post-384360)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
