Images published in WordPress themes also known as post thumbnails. Today most WordPress photography themes, restaurant themes, church themes, and other types of themes have built-in support for post thumbnails. In this article, we will show you how to add featured images or post thumbnails in WordPress.
Simple post with image Post Thumbnails in WordPress
You may wonder why we are using rich images and post thumbnails together. Well, when this feature was first introduced in WordPress 2.9, it’s called Post Thumbnails. However, in the next version, his name placed on the prominent image.
Guide to Featured Images in Early WordPress
Featured images or post thumbnails are a feature of the theme. Most themes support images like Genesis and other features by default..
An uncomplicated way to find out if your theme supports featured images is by going to a post editor. Just create a recent post and scroll down a bit to see if there’s a meta box called Featured Images on the right-hand side of the screen..
Qum Soluta Nobis Eleifend
If you don’t like the video or need more instructions, keep reading.
Adding post thumbnails or featured images to WordPress
To add a featured image to a WordPress post, just click the “Set Featured Image” link inside the featured image meta box shown in the screenshot.
This will open the WordPress Media Uploader. You can use it to upload an image from your computer or use an image from your media library. Once you select the icon, just click the Set Featured Image button.
This image will appear in the featured image meta box, such as
- It is important to note that the image may look a little different in your theme. It all depends on how your theme handles the featured images.
- Some magazine themes use small thumbnails with side post summaries on the homepage and a larger version on the single post view.
Depending on the settings specified by your theme developer, your featured image will automatically appear with your posts. However, if you want to change the way you handle the images and post thumbnails featuring your theme, keep reading.
Note: Everything below this will require coding knowledge.
Theme developers are leading guides for featuring images and post thumbnails in WordPress.
Although the featured image is a popular feature that has a lot of support, you may use a theme that does not support featured images. Here, you can add featured image support to your theme. If you are easy to edit themes files and know your way around a little CSS, you can do it yourself.
To add featured image support to your WordPress theme, you need to add this line of code to your theme’s functions. pp file.
add_theme_support (‘later thumbnails’);
This code will enable featured image support for posts and pages. You can now go to posts or pages, and you will see the featured image option enabled. However, when you compose a rich image, it does not automatically appear in your WordPress theme. To display featured images in your theme, you need to edit your templates and add this line of code where you want the featured image to appear:
<? PHP the_post_thumbnail () ?>
The files in this code vary depending on your theme. Add code inside your post loop.
The above code is the basic function in which you need to display prominent images support and prominent images in your theme. To set the size of the image for the features you uploaded, you need to include this line of code in your functions.ppp file.
set_post_thumbnail_size (50, 50)
The parameters of set_post_thumbnail_size are in this order: width, height.
You can also set additional image sizes to use with the_paste_thumbnail () function. For example:
For one of the letters // image size
add_image_size (‘single post-thumbnail’, 590, 180);
In this example, we have added an extra image size called single post thumbnail with a height of 590px and 180px. To use this image size in our theme, we will still need to add it to the theme file. Check out our guide on how to add additional image sizes to WordPress for more details.
If you have already uploaded rich images, but they still appear in the original size, you need to recreate the thumbnail and image size for older posts.
Below is an example of a featured image function with specific image size.
<? php the_post_thumbnail (‘single post thumbnail’); ?>
This is a broken version of full functionality. You can further enhance the functionality of more featured images. For example, you can set a default fallback image for post thumbnails, display featured images with captions, or add multiple post thumbnails or featured images.
We hope this article helps you learn how to add featured images or post thumbnails in WordPress. You’ll also want to check out our 14 best-featured plugins and tutorials for WordPress.
If you liked this article, please subscribe to our YouTube channel for WordPress video tutorials. You can also find us on Twitter and Facebook.