• I want to display a specific post (using the post id) and the code below…However, I cannot seem to get where to insert the post id to do the magic for me. Any help pls?

    <ul class="sidebar_r">
    	<?php global $included_pic; $showpost = new WP_query(); $showpost->query(array('category__in'=>$included_pic,'post__not_in'=>array($post->ID),'showposts'=>1)); ?>
    	<?php if ($showpost->have_posts()) : ?>
    
    <li><h2><?php _e('Recently Posted Photos','redc'); ?></h2>
    	<?php while ($showpost->have_posts()) : $showpost->the_post(); ?>
    	<div class="recphoto">
    	<div class="pic"><?php show_thumb($redcarpet['big_thumb_h'],$redcarpet['big_thumb_h'],$redcarpet['crop'],$redcarpet['cropfrom'],$redcarpet['quality']); ?></div>
    	<h3><a>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
    	<div class="sum"><a>" title="<?php the_title(); ?>"><?php print do_excerpt(get_the_excerpt(), 15); ?></a></div>
    	<div class="readit"><a>"><?php _e('See photos','redc'); ?></a></div><div class="clear"></div>
    	</div>
    	<?php endwhile; ?>
    	</li>
    	<?php endif; ?>
Viewing 1 replies (of 1 total)
  • I think you need to change ‘post__not_in’ to ‘post__in’ here:

    <ul class="sidebar_r">
    	<?php global $included_pic; $showpost = new WP_query(); $showpost->query(array('category__in'=>$included_pic,'post__not_in'=>array($post->ID),'showposts'=>1)); ?>
Viewing 1 replies (of 1 total)
  • The topic ‘How Do I Use A Post ID To Display A Post Using This Code?’ is closed to new replies.