I am using the following code to print another image that is in my images folder in casa a post has no thumbnail but it is giving me errors on the else statement saying that there is a syntax error:
<?php if ( has_post_thumbnail() ) {
echo '<a href="<?php the_permalink(); ?>"> <figure><?php the_post_thumbnail(); ?></figure></a>';
}
else {
echo '<figure><img src="<?php echo get_bloginfo( 'template_directory' ); ?>/images/stone.jpg" /></figure></a>';
}
?>
However, if I paste this code:
<?php if ( has_post_thumbnail() ) {
echo '<a href="<?php the_permalink(); ?>"> <figure><?php the_post_thumbnail(); ?></figure></a>';
}
else{
}
?>
It gives no error but also it does not display the thumbnail
Hope you can help