WordPress has this amazing feature known as Post Thumbnails also known as Featured Images. When loading a post thumbnail, you're prompted to add a title, description, along with other fields, but when you're ready to display it, it only displays the image. In this article, we'll share a little trick that will allow you to display captions or full image descriptions with your post thumbnail.
The first thing you need to do is enable thumbnail publishing in your WordPress theme. Now when you upload an image using the media uploader, you'll see something like this:
You will need to go ahead and fill in all the information. Now, one thing that many people don't know is that WordPress stores each image as its own post. So the image title will be the post title, the title will be the post excerpt, and the description will be the post content. Therefore, you can display all of this information when you are displaying your WordPress thumbnail.
To display your post thumbnail with its title, simply paste the following code inside the loop:
post_excerpt; ?>
Obviously, you can style it however you want.
You can also display the full description of the image by adding this code inside the post loop:
Publicar Contenido; ?>
This really simple trick can go a long way in designing your next custom WordPress theme.