Title: Random posts loop
Last modified: August 21, 2016

---

# Random posts loop

 *  [MrAkram](https://wordpress.org/support/users/mrakram/)
 * (@mrakram)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/random-posts-loop/)
 * i have used the loop for my theme homepage
    but when i go page 2 or 3 , 4 …etc
   i got the same random posts in all pages i wanna make the loop generate different
   random posts each page .
 *     ```
       <?php query_posts("showposts=8&orderby=rand"); ?>
                     <?php if ( have_posts() ) : while ( have_posts() ) :                     the_post(); ?>
       <-- quotes content -->
                     <?php endwhile; else: ?>
                     <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
                     <?php endif; ?>
       ```
   

The topic ‘Random posts loop’ is closed to new replies.

## Tags

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

 * 0 replies
 * 1 participant
 * Last reply from: [MrAkram](https://wordpress.org/support/users/mrakram/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/random-posts-loop/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
