Title: Display Random Articles With Thumbnails in Posts
Last modified: August 19, 2016

---

# Display Random Articles With Thumbnails in Posts

 *  [wp_girl](https://wordpress.org/support/users/wp_girl/)
 * (@wp_girl)
 * [17 years, 8 months ago](https://wordpress.org/support/topic/display-random-articles-with-thumbnails-in-posts/)
 * Hello,
 * I have tried to display at the bottom of my post random articles and thumbnails(
   this are from custom fields) but with no success.
 * I have used this code:
 *     ```
       <?php $my_query = new WP_Query('orderby=rand&showposts=4');
       while ($my_query->have_posts()) : $my_query->the_post();
       ?>
   
       <li><a href="<?php the_permalink() ?>"><img style="border: none;" alt="random article" src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo get_post_meta($post->ID, "thumb", true); ?>&amp;h=47&amp;w=140&amp;zc=1;" /></a>
       ```
   
 * The good news it that it generates random articles with thumbnails in my post,
   but the bad news it that it random the comments from my blog also.
 * Any help will be much appreciated !
 * Thank you.

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

 *  Thread Starter [wp_girl](https://wordpress.org/support/users/wp_girl/)
 * (@wp_girl)
 * [17 years, 8 months ago](https://wordpress.org/support/topic/display-random-articles-with-thumbnails-in-posts/#post-930416)
 * Nobody :(((( ?
 *  Thread Starter [wp_girl](https://wordpress.org/support/users/wp_girl/)
 * (@wp_girl)
 * [17 years, 8 months ago](https://wordpress.org/support/topic/display-random-articles-with-thumbnails-in-posts/#post-930418)
 * any help 🙁 ?
 *  [ronchicago](https://wordpress.org/support/users/ronchicago/)
 * (@ronchicago)
 * [17 years, 8 months ago](https://wordpress.org/support/topic/display-random-articles-with-thumbnails-in-posts/#post-930431)
 * not sure what you mean exactly…sorry.
 * your setup =
    post 1 content post 1 comments
 * followed by…
    random articles with thumbs ( no comments on these guys )
 * what’s happening?…
    your post 1 comments are random? meaning what – all post 
   1 comments but out of order? or random comments appearing from other posts?

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

The topic ‘Display Random Articles With Thumbnails in 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: [ronchicago](https://wordpress.org/support/users/ronchicago/)
 * Last activity: [17 years, 8 months ago](https://wordpress.org/support/topic/display-random-articles-with-thumbnails-in-posts/#post-930431)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
