I am trying to link to an image in a loop in wordpress but it is not displaying properly. The image will be set so its not being pulled from the article. Here is the code where I am making an error.
echo '<img alt="'.the_title(); <?php echo "src=/"". bloginfo('template_directory').'/images/green/newsImg1.png " />';
And here is the full code to anyone who needs it.
<?php query_posts('cat=3&showposts=2'); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="newsPreview mb15">
<?php
{
echo "<img alt=\"".the_title(). "\" src="\".bloginfo('template_directory')." />";
echo '<img alt="'.the_title(); <?php echo "src=/"". bloginfo('template_directory').'/images/green/newsImg1.png " />';
}
?>
<span class="previewTitle"><a href="<?php the_permalink() ?>" title=""><?php the_title(); ?></a></span>
<?php the_excerpt('');?>
</div>
<?php endwhile; else : ?>
<?php endif; ?>
Thank you in advance for your help.