pierrebalian of Rocket55 Web Team
7/10/2017 - 6:58 PM

makes the thumbnail output consistent with posts, wraps them in figure tag and includes caption in figcaption. use css psuedo:empty to hid

makes the thumbnail output consistent with posts, wraps them in figure tag and includes caption in figcaption.

use css psuedo:empty to hide empty captions.

<?php if ( has_post_thumbnail() ) { ?>
	<?php echo '<figure class="wp-caption">' . get_the_post_thumbnail( $page->ID, 'full-width') . '<figcaption class="wp-caption-text">' . get_post(get_post_thumbnail_id())->post_excerpt . '</figcaption></figure>'; ?>
	<?php } ?>