Give Your Post a Thumbnail and Display it on the Home Page

November 29, 2012

There are circumstances where you want to display thumbnails in the post which will link to the post.

featured image

Well, WordPress introduced this feature in version 2.9 onwards. This article explains how to give your post a thumbnail then display it on the home page.

To use this feature you need to do  three important things:
1. Check to see if the theme supports thumbnails already – if so, go to step 3
2. If not, then turn on post thumbnail support.
3. Upload and set up featured image.

Step1: Check if this is enabled in your theme.

To display featured image in a post, you need to enable thumbnail support within your theme. Most themes support featured images by default.

How to check if this is enabled in your theme.
From your wordpress Dashboard, go to Posts>>AddNew. Now you can see post writing screen. If your theme supports featured images, you will see a meta box called featured images on the right hand side of the screen. Go to step3.

Featured Image

If you do not see this featured images meta box, this feature is not enabled in your theme.

Step2: Enable Thumbnail Support

How to enable Featured Images /  in wordpress
You need to add a small line of  code in  ‘functions.php’ file within your theme folder (wp-content/themes/theme-name/). From wordpress dash board go to Appearance>>Editor

Go to theme editor

Now you will see built-in Appearance Editor Screen. On the right there will be a list of the Theme Template files that can be edited. Click on functions.php.

edit functions.php

Put the following code in functions.php file.

add_theme_support( 'post-thumbnails' );

Go back to your post write screen. Now you will see “Featured Image” box on your WordPress post writing screen.

Step3: Set featured image

Click on ‘Set featured image’ link.

Set up image

Upload/select an image ( Refer the article >> How To Insert Images into WordPress Posts and Pages). Once you have selected the featured image and determined the image settings, click on the blue “Set featured image” button, to set it as the featured image for your page or post.

set up image


How to change Thumbnail Sizes

Default thumbnail sizes can be changed in WordPress’s Settings > Media screen.

Featured Image Size

However, after making any changes in  media settings screen, by default wordpress do not resize images on the fly. This means any featured images that were added prior to this remain unaffected. Resizing each of these images, manually, is not practical for anyone with hundreds of posts . In such a case, you can use the plugin called ‘Regenerate Thumbnails’ to regenerate the new image size.

  1. Install and activate the Regenerate Thumbnails plugin.(Refer the article>> how to install plugin)
  2. After activation , go to Tools » Regen. Thumbnails .There click Regenerate Thumbnail icon and let the plugin do its job.
    regenerate image

    Note: You can also Regenerate thumbnails in bulk as shown below under Media  Library Page. Go to Media » Library from left menu. Select all the images for which you want to re-generate the thumbnails and choose “Regenerate thumbnails” in the drop down, press Apply.

    regenerate thumb

    Alternately, you can regenerate thumb for single images in the Media Library. Pass mouse over the image row, then you will see Regenerate Thumbnails link.

    regenerate thumb

How to Set up a default featured image

If you forget to set up featured image for your post an empty box will be show next to your post. One way to avoid this is by saving a permanent default featured image. There is a plugin called ‘Default Featured Image’ that let you set up a default image as featured image. (You may solve this by using following plugins also: Require Featured Image – that let you publish the post only after setting featured image  , Auto Set – to set the first image of your post to Featured Image ). Let us see how to set up  Default Featured Image.

  1. Install and activate the Default Featured Image plugin.(Refer the article >>  how to install wordpress plugin)
  2. After activation, go to Settings » Media .There you can see new options to set up default featured image.

    Upload image
  3. Now you are done! This default image will display in posts with no featured image added manually.

How to Create a for Your WordPress Post


How to Add Multiple Post Thumbnails/Features