Displaying specific posts and NOT most recent (Wordpress)

Discussion in 'Programming' started by dbj_us, Jan 22, 2009.

  1. #1
    Hi everyone,

    I want to display three specific posts in a section on my homepage. Right now the section displays always the three most recent posts. I have tried to change the php code multiple times but I always get an error message.Here is the code that apparently has to been changed. Let's suppose the ID's of the posts are 11; 22; and 33

    <?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, ""); ?>
    				
    				<div style="border-bottom:1px dotted #94B1DF; margin-bottom:10px; padding:0px 0px 10px 0px; clear:both;"></div>
    				
    				<?php endwhile; ?>
    
    PHP:
    I really hope someone can help me. Thank you!!!!
     
    dbj_us, Jan 22, 2009 IP