Title: Random Post in AMP
Last modified: August 31, 2016

---

# Random Post in AMP

 *  Resolved [aroengbinang](https://wordpress.org/support/users/aroengbinang/)
 * (@aroengbinang)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/random-post-in-amp/)
 * Hi,
 * Need help on how to get random post in AMP (Accelerated Mobile Pages). As for
   regular pages, below script works for me, but it doesn’t work on AMP.
 *     ```
       <h3>Title</h3>
       <ul>
       <?php $posts = get_posts('orderby=rand&numberposts=3'); foreach($posts as $post) { ?>
       <li><a href="<?php the_permalink(); ?>" ><?php the_title(); ?></a>
       </li>
       <?php } ?>
       </ul>
       ```
   
 * Thanks in advance,

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

 *  [Sakar Upadhyaya Khatiwada](https://wordpress.org/support/users/sakaruk/)
 * (@sakaruk)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/random-post-in-amp/#post-7206964)
 * I think you can take help of some plugins
 * [https://wordpress.org/plugins/amp/](https://wordpress.org/plugins/amp/)
 *  Thread Starter [aroengbinang](https://wordpress.org/support/users/aroengbinang/)
 * (@aroengbinang)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/random-post-in-amp/#post-7206970)
 * Thanks for the suggestion, I should have posted it at the plugin’s support thread.
 *  [Sakar Upadhyaya Khatiwada](https://wordpress.org/support/users/sakaruk/)
 * (@sakaruk)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/random-post-in-amp/#post-7206978)
 * If your question has been answered, we would love if you would mark this topic
   as resolved in the right hand sidebar. This helps our volunteers find the topics
   that still need attention and more people will get helped, possibly like you 
   did.
 *  Thread Starter [aroengbinang](https://wordpress.org/support/users/aroengbinang/)
 * (@aroengbinang)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/random-post-in-amp/#post-7206981)
 * Alright, thanks.

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

The topic ‘Random Post in AMP’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [aroengbinang](https://wordpress.org/support/users/aroengbinang/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/random-post-in-amp/#post-7206981)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
