WordPress has this wonderful function referred to as Post Thumbnails additionally referred to as Featured Images. When importing a submit thumbnail, you’re requested to upload a caption, description, alongside with different fields, however whilst you get able to show it, it most effective displays the picture. In this text, we can percentage a small trick that may will let you show captions or complete symbol descriptions with your submit thumbnail.
First factor first, you wish to have to allow Post Thumbnails on your WordPress Theme. Now, whilst you add a picture the usage of the media uploader, you’re going to see one thing like this:
You will want to cross forward and fill the entire knowledge. Now something that many other folks have no idea is that WordPress shops every symbol as its personal submit. So the Title of the Image would be the identify of the submit, Caption would be the excerpt of the submit, and Description would be the content material of the submit. So you’ll show all of those knowledge when you’re exhibiting your WordPress Thumbnail.
To show your submit thumbnail with its caption, merely paste the next code throughout the loop:
<?php the_post_thumbnail(); echo get_post(get_post_thumbnail_id())->post_excerpt; ?>
You can clearly taste it the way in which you wish to have to taste it.
You too can show complete symbol description via including this code throughout the submit loop:
<?php the_post_thumbnail(); echo get_post(get_post_thumbnail_id())->post_content; ?>
This in reality easy trick can cross great distance in styling your subsequent customized WordPress theme.