How to Display WordPress Post Thumbnails with Captions

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.

Recent Articles

The Best Pinterest Alternatives to Use if You are Bored of Pinterest

Pinterest is a loved social media network among the lover of aesthetics, mostly females tbh. Now, however more and more people are...

Ways you can add links to your Instagram post in 2021

Instagram has many cool features which need no introduction. However, there are a number of features that...

Finance App You should Have on Your iPhone and Android

We live in the age of digitization. When everything is digital, it is no surprise that money has joined the club too....

5 Video Editing Softwares to Try Your Hand at in 2021

Video is the king when it comes to social media. With reels dominating Instagram and Facebook and...

Charge Your Laptop Without a Charger in 5 Ways

Forgetting your laptop charger is a pretty common thing. We all have been there and all of...

Related Stories

Leave A Reply

Please enter your comment!
Please enter your name here