Created
December 27, 2017 16:21
-
-
Save diggeddy/872e4e98bbe0a8f496484c97af92fda5 to your computer and use it in GitHub Desktop.
Add post thumbnail with short code
This file contains hidden or 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
/* Post thumbnail shortcode */ | |
add_shortcode('featured_img', 'fi_in_content'); | |
function fi_in_content($atts) { | |
global $post; | |
return get_the_post_thumbnail($post->ID); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment