I've been working on a redesign for a website on a local development setup and have decided to give a shot at WordPress for the first time. On my front page, I have an image slider that slides through the three most recently posted items that I want on the front page. On all of the posts, I have attached an image that I want to display on the front page. Here's my code on the homepage:
<?php query_posts('category_name="main page"&showposts=3'); while ( have_posts() ) : the_post(); ?> <div class="panelContent"> <img class="panelPhoto" src="<?php echo wp_get_attachment_url(get_the_ID()); ?> "/> <div class="panelCaption"> <h2><?php the_title(); ?></h2> <?php the_excerpt(); ?> </div> </div> <?php endwhile; ?>
The code returns an underscore in the src part of the img tag. Not exactly sure why.
Also, here's an image of my media panel showing that the images are indeed attached: