First, let me start off by saying I'm very new to WordPress. I've only ever done basic themes before, this is my first big project.
I'm working on a design that has two sidebars on every page. Each sidebar displays the most recent post from two categories. These posts have Featured Images associated with them. I want to display the posts featured images in the sidebars on every page, but I can't figure out how to do it. The Feature Image always wants to pull the image from the current page, not the posts I'm trying to display. Or it just doesn't do anything at all.
Is there a way to do this, or do I have to resort to using a widget? I'd really prefer not to have to do a widget, because it'd be much easier for the client to just post something and have it appear in the sidebar.
Here's the code I'm trying to use (which currently just doesn't display any featured image):
<?php query_posts('category_name=Festivals','showposts=1'); ?>
<?php while (have_posts()) : the_post(); ?>
<?php
if(has_post_thumbnail( $id )) {
echo get_the_post_thumbnail( $id, 'full');
}
?>
<p><?php the_time('M j') ?>: <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
<?php endwhile;?>