I have created a shortcode to display the featured image linking to the post:
function ck13_post_image($atts){
extract(shortcode_atts(array(
'ck_img_size' => 'full'
), $atts));
$show_the_image .= '<a href="' . get_permalink() . '">' . the_post_thumbnail("$ck_img_size") . '</a>';
return $show_the_image;
}
//---------------------------------------------
function register_shortcodes(){
add_shortcode('show-post-img', 'ck13_post_image');
}
add_action( 'init', 'register_shortcodes');
But instead of displaying the image inside the post, the image is displayed above it.
The weird thing is that the link to the post is displayed correctly inside the post, just the image is above.
Did i make some mistake? How can i make this work?