Title: Random Posts
Last modified: August 19, 2016

---

# Random Posts

 *  [dbunit16](https://wordpress.org/support/users/dbunit16/)
 * (@dbunit16)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/random-posts-2/)
 * I am running some queries to get posts from certain categories. By default they
   show the most recent posts in the category. How can I hve them show RANDOM posts
   from the category?
 * For example:
 *     ```
       <?php query_posts('category_name=coyotes&showposts=3'); ?>
       ```
   
 * Thanks for the help!

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

 *  [@mercime](https://wordpress.org/support/users/mercime/)
 * (@mercime)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/random-posts-2/#post-943389)
 * [http://codex.wordpress.org/Template_Tags/get_posts#Random_posts](http://codex.wordpress.org/Template_Tags/get_posts#Random_posts)
 *  Thread Starter [dbunit16](https://wordpress.org/support/users/dbunit16/)
 * (@dbunit16)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/random-posts-2/#post-943399)
 * Perfect! I searched but couldn’t find it! Thanks so much!
 *  Thread Starter [dbunit16](https://wordpress.org/support/users/dbunit16/)
 * (@dbunit16)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/random-posts-2/#post-943429)
 * Thanks for the help. I’m having a bit of trouble with my initial loop though,
   can someone please help me?
 *     ```
       <?php query_posts('numberposts=3&orderby=rand&category=60'); ?>
       <?php while (have_posts()) : the_post(); ?>
       ```
   

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

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [dbunit16](https://wordpress.org/support/users/dbunit16/)
 * Last activity: [17 years, 5 months ago](https://wordpress.org/support/topic/random-posts-2/#post-943429)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
