// Featured Thumbnail function featured_thumbnail() { ob_start(); ?> <div class="thumbnail-block"> <?php $featured_img_url = get_the_post_thumbnail_url( get_the_ID(),'full'); ?> <div class="page-thumbnail" style="background-image: url('<?php echo $featured_img_url; ?>');"></div> </div> <?php return ob_get_clean(); } add_shortcode ('featured_thumbnail','featured_thumbnail');
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter