Title: Top row random post thumbnails
Last modified: August 19, 2016

---

# Top row random post thumbnails

 *  [totyo](https://wordpress.org/support/users/totyo/)
 * (@totyo)
 * [15 years, 12 months ago](https://wordpress.org/support/topic/top-row-random-post-thumbnails/)
 * Hi,
 * I’m running a blog with a lot of images and I would like to create a “top row”
   system which display a list, side to side of X random thumbnails which are picked
   on random posts (each post have its own thumbnail).
 * When clicking on the thumbnail, the corresponding post is loaded.
 * In fact, something similar to [http://www.zbrushcentral.com](http://www.zbrushcentral.com)(
   on the top, but it’s not random).
 * I looked at the existing random post plugins, but none of them seems to do what
   I’m looking for, even with some tweaking.
 * I’m not really a coder, then if you have some ideas or where I can look at 🙂
   A php code is ok as I will insert it in the template directly.
 * Thanks!

Viewing 1 replies (of 1 total)

 *  Thread Starter [totyo](https://wordpress.org/support/users/totyo/)
 * (@totyo)
 * [15 years, 12 months ago](https://wordpress.org/support/topic/top-row-random-post-thumbnails/#post-1498289)
 * I’m replying for others if you are looking for this solution as I found something
   related to that (It seems that I didn’t search enough…)
 * [http://wordpress.org/support/topic/366086?replies=2](http://wordpress.org/support/topic/366086?replies=2)
 * Then this is my “updated” code:
 *     ```
       <?php global $post;
       $rand_posts = get_posts('numberposts=6&orderby=rand');
       foreach( $rand_posts as $post ) : ?>
       <a href="<?php the_permalink($page->ID) ?>" title="<?php the_title(); ?>">
       <?php echo get_the_post_thumbnail($post->ID, 'thumbnail'); ?></a>
   
       <?php endforeach; ?>
       ```
   
 * Now, I have to update some of my post thumbnails and find a way to add a default
   thumbnail when the post don’t have image or exclude the posts which doesn’t have
   thumbnails.

Viewing 1 replies (of 1 total)

The topic ‘Top row random post thumbnails’ is closed to new replies.

## Tags

 * [banner](https://wordpress.org/support/topic-tag/banner/)
 * [thumbnail](https://wordpress.org/support/topic-tag/thumbnail/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [totyo](https://wordpress.org/support/users/totyo/)
 * Last activity: [15 years, 12 months ago](https://wordpress.org/support/topic/top-row-random-post-thumbnails/#post-1498289)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
