Created
June 25, 2019 19:51
-
-
Save diggeddy/8430ed1ef98b61b45df988ebdc157f15 to your computer and use it in GitHub Desktop.
Output featured image shortcode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function db_feat_img_shortcode() { | |
$img_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'large', false ); | |
return '<img src="' . $img_src[0] . '"/>'; | |
} | |
add_shortcode( 'db_feat_img', 'db_feat_img_shortcode' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment