Answers for "check if post has featured image wordpress"

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 "check if post has featured image wordpress"

Browse Popular Code Answers by Language