Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

wordpress if thumbnail show else

<?php if ( has_post_thumbnail() ) {
the_post_thumbnail();
} else { ?>
<img src="<?php bloginfo('template_directory'); ?>/images/default-image.jpg" alt="<?php the_title(); ?>" />
<?php } ?>
Source by www.wpbeginner.com #
 
PREVIOUS NEXT
Tagged: #wordpress #thumbnail #show
ADD COMMENT
Topic
Name
8+1 =