Title: Display specific posts, NOT most recent!
Last modified: August 19, 2016

---

# Display specific posts, NOT most recent!

 *  Resolved [do77](https://wordpress.org/support/users/do77/)
 * (@do77)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/display-specific-posts-not-most-recent/)
 * Hey everyone,
 * I am featuring some posts from a specific category on the homepage. The problem
   is that the sections always displays the most recent posts but I want to choose
   which posts I want to display by ID. Unfortunately I dont know how to change 
   the code so that the sections would only display the post ID’s I put in there.
 * Here is the code:
 *     ```
       <?php $recent = new WP_Query("cat=166&showposts=3"); while($recent->have_posts()) : $recent->the_post();?>
   
       				<?php if( get_post_meta($post->ID, "thumbnail", true) ): ?>
       				    <a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;" src="<?php echo get_post_meta($post->ID, "thumbnail", true); ?>" alt="<?php the_title(); ?>" /></a>
       				<?php else: ?>
       				   	<a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;"  src="<?php bloginfo('template_url'); ?>/images/thumbnail.png" alt="<?php the_title(); ?>" /></a>
       				<?php endif; ?>
       				<b><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></b>
       				<?php the_content_limit(80, ""); ?>
       ```
   
 * Can someone help me with that. I have been trying it multiple times but I always
   get error messages. I want to feature a total of 3 posts.
 * Thank you so much,
    Dom

Viewing 1 replies (of 1 total)

 *  Thread Starter [do77](https://wordpress.org/support/users/do77/)
 * (@do77)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/display-specific-posts-not-most-recent/#post-966305)
 * I replaced
 * > while($recent->have_posts())
 *  with an array and included specifc post ID’s.
 * In case someone had the same problem!

Viewing 1 replies (of 1 total)

The topic ‘Display specific posts, NOT most recent!’ is closed to new replies.

## Tags

 * [feature](https://wordpress.org/support/topic-tag/feature/)
 * [specific posts](https://wordpress.org/support/topic-tag/specific-posts/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [do77](https://wordpress.org/support/users/do77/)
 * Last activity: [17 years, 3 months ago](https://wordpress.org/support/topic/display-specific-posts-not-most-recent/#post-966305)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
