Answers for "wordpress check if page has thumbnail"

PHP
0

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 } ?>
Posted by: Guest on March-13-2020

Code answers related to "wordpress check if page has thumbnail"

Browse Popular Code Answers by Language