I need to build a PHP if/else statement. What I don’t know how to do is addHTML in the middle of it… Specifically, where the <?php and ?> tags would go…
The snippet I am working with is
<?php if ( has_post_thumbnail($some_post['ID']) ) {
echo get_the_post_thumbnail($some_post['ID']);
}
else {
echo get_stylesheet_directory_uri() . '/assets/img/hero-thumbnail-default.jpg';
} ?>
I need to add img tags around
echo get_stylesheet_directory_uri() . ‘/assets/img/hero-thumbnail-default.jpg’;
So that that piece is echoed inside an img tag… I can’t seem to figure out how to add the HTML portion (the img tag) inside the if/else statement.