How to Add Featured Images or Post Thumbnails in WordPress

By WP Saviour •  Updated: 08/11/20 •  5 min read

Featured photos also referred to as put up thumbnails are a well-liked function in WordPress themes. Immediately most WordPress images themes, restaurant themes, church themes, and different varieties of themes have built-in assist for put up thumbnails. On this article we’ll present you find out how to add featured photos or put up thumbnails in WordPress.

You could be considering why are we utilizing featured picture and put up thumbnail interchangeably. Effectively, when this function was first launched in WordPress 2.9, it was referred to as put up thumbnails. Nonetheless, within the subsequent model it was renamed to featured picture.

Saviours Information to Featured Photographs in WordPress

Featured Photographs or Publish Thumbnails is a theme function. Most themes comparable to Genesis and others assist featured photos by default.

A straightforward means to determine whether or not your theme helps featured photos is by going to the put up editor. Merely create a brand new put up and scroll down a bit of to see if there’s a meta field referred to as featured photos on the best hand facet of the display screen.

featuerd-image-wordpress-7466563

Including Publish Thumbnail or Featured Picture in WordPress

So as to add a featured picture in a WordPress put up, merely click on on “Set Featured Picture” hyperlink contained in the featured picture meta field proven within the screenshot above.

This may open the WordPress Media Uploader. You should utilize that to add a picture out of your laptop or use an current picture out of your media library. As soon as you choose the picture, merely click on on Set Featured Picture button.

set-featured-image-1898171

The picture will seem within the Featured Picture meta field, like this:

setting-featured-image-7481097

You will need to observe that the picture could seem a bit of bit otherwise in your theme. All of it depends upon how your theme handles featured photos.

Some journal themes use smaller thumbnails alongside facet put up summaries on the principle web page, and a bigger model on the only put up view.

Relying on settings outlined by your theme developer, your featured picture will mechanically seem along with your posts. Nonetheless, if you wish to change the best way your theme handles featured photos and put up thumbnails then proceed studying.

Observe: All the things beneath it will require coding data.

Theme Builders Information to Featured Picture and Publish Thumbnails in WordPress

Though featured picture is a well-liked function supported by a lot of themes, it’s nonetheless potential that you just could be utilizing a theme that doesn’t assist featured photos. In that case, you’ll be able to add featured picture assist to your theme. If you’re snug modifying theme information and know your means round a bit of CSS, then you are able to do it your self.

So as to add featured picture assist in a WordPress theme, it’s essential add this line of code in your theme’s features.php file:

1

add_theme_support( 'post-thumbnails' );

This code will allow featured picture assist for posts and pages. Now you can go to posts or pages, and you will notice featured picture choice enabled. Nonetheless, if you set a featured picture it won’t mechanically show in your WordPress theme. To show featured photos in your theme, it’s essential edit your templates and add this line of code the place you wish to show the featured picture:

1

The information you add the above code in will range primarily based in your theme. It would be best to add the code inside your put up loop.

The above code is the essential perform that it’s essential add featured picture assist and show featured photos in your theme. To set picture dimension for featured photos you add, it’s essential add this line of code to your features.php file.

1

set_post_thumbnail_size( 50, 50);

The parameters for set_post_thumbnail_size are on this order: width, peak.

It’s also possible to set further picture sizes to make use of with the_post_thumbnail() perform. For instance:

1

2

add_image_size( 'single-post-thumbnail', 590, 180 );

On this instance we now have added a brand new picture dimension referred to as single-post-thumbnail with 590px with and 180px peak. To make use of this picture dimension in our theme, we’ll nonetheless want so as to add it within the acceptable theme file. Checkout our information on including further picture sizes in WordPress for extra particulars.

When you have beforehand uploaded featured photos, however they’re nonetheless showing in another dimension, then it’s essential regenerate thumbnails and picture sizes for older posts.

Beneath is an instance of the featured picture perform with a selected picture dimension.

1

That is damaged down model of the complete performance. You’ll be able to additional lengthen the performance of featured photos. For instance, you’ll be able to set a default fallback picture for put up thumbnails, show featured photos with captions, and even add multiple post thumbnails or featured images.

We hope that this text helped you discover ways to add featured photos or put up thumbnails in WordPress.

gp-7104108 as-2771717

WP Saviour

I am a WordPress specialist. My mission is to help you create beautiful websites with ease!