Title: Random query_posts
Last modified: August 19, 2016

---

# Random query_posts

 *  [jor133d](https://wordpress.org/support/users/jor133d/)
 * (@jor133d)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/random-query_posts/)
 * I have a question regarding query_posts.
 * This is what I currently have:
 *     ```
       <?php query_posts(array('orderby' => 'rand', 'showposts' => 21)); ?>
       ```
   
 * How do I get it so it shows 21 posts from the last month, not of all time?

Viewing 1 replies (of 1 total)

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/random-query_posts/#post-1405494)
 * Look at the Time parameter examples in the query posts article.
 * [http://codex.wordpress.org/Template_Tags/query_posts#Time_Parameters](http://codex.wordpress.org/Template_Tags/query_posts#Time_Parameters)

Viewing 1 replies (of 1 total)

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [MichaelH](https://wordpress.org/support/users/michaelh/)
 * Last activity: [16 years, 2 months ago](https://wordpress.org/support/topic/random-query_posts/#post-1405494)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
