Home / Admin / Shortcode to show Thumbnail
Duplicate Snippet

Embed Snippet on Your Site

Shortcode to show Thumbnail

Show the featured image anywhere in the post by using [thumbnail].

Code Preview
php
<?php
add_shortcode('thumbnail', 'thumbnail_in_content');
function thumbnail_in_content($atts) {
    global $post;
    return get_the_post_thumbnail($post->ID);
}

Comments

Add a Comment