WordPress, save an image as featured
A step by step guide to the post thumbnail for WordPress. More appropriately the Featured Image.
Just recently, I published few resources and articles about how to enhance the Post Thumbnail feature, via the
functions.php file. Still a consistent part of visitors seem to look for a more simple, straightforward approach. Let’s see how to activate and use the Featured Image.
Activate the Featured Image Panel
By default, the Panel for setting up the Featured Image is not visible, and the feature is not even active. So, if the theme does not still make use of such a feature, we need to open the
functions.php file with an editor and add the following line:
<?php add_theme_support( 'post-thumbnails' ); ?>
For reference, here how to find and manipulate the
functions.php file. On the other hand, you may want to learn more about the function add_theme_support. It can be used to register and activate certain theme features.
Once added the line and saved the
functions.php file, the Featured Image panel should be visible when editing a post, just below the Post Tags Panel.
Uploading a Featured Image
Great, now we have the panel. Let’s use it! We have two ways: via the Featured Image panel itself, or adding images through the Upload/Insert icons (see later). Let’s see the first in details.
We can click directly on Set Featured Image, and open the modal windows Set featured image, through which we can upload a new media (in this case, a picture). Click on Select Files, pick up an image, and go. You could upload more pictures at the same time, but to keep it simple for now, let’s say we want to just pick up a single image and to use it as Featured. Select a file, and upload it.
We should be now at this point.
Before to click on Use as featured image and elect this picture as the Post Thumbnail, I would like to give you few tips for a better SEO.
Quick SEO tips
I would never forget or omit to fill up the fields for Title, Alternate Text and Description of the image. What they represent is quite straightforward, they can be used brilliantly by well coded themes, and they can have quite an important impact for the SEO of the page. In details:
- Title: it’s the title of the page, it appears when the pointer of the mouse lingers on the pictures, as tool tip.
- Alternate Text: it’s important for the accessibility of the page, and it becomes visible when the picture is not properly loaded (note: a search engine can’t see images, it mainly reads the Alternate Text).
- Caption: if the picture requires a caption, or a legend, this is where you can add the text for it.
- Description: beside the caption, you may want to describe the picture for later uses (for instance, on the Media Page); it’s also a good place where to write few lines you would forget in future.
Once you’re satisfied with all the above, click on Use as featured image and go magic. You should see something like the screenshot below.
This article is not about how to use the build in function the post thumbnail. I’ll write soon about it, and about the other useful build in function set post thumbnail size. If your theme use it, at this point you should see thumbnails appear gracefully on your website.
Uploading more pictures and then elect one as Featured Image
An other way to pick up an image as Featured, it’s through the media icons Add an Image, and then, before to save and close, set one of the pictures as Featured.
Not really different than the way we’ve just seen. If there is confusion about, drop me a line and I’ll show detailed screenshot for this task, as well.
Changing or Removing a Featured Image
To remove a Featured Image, scroll down to Featured Image panel and click on Remove featured image. To pick up a different one, upload a new image as we’ve just seen, or open the Gallery and select an other image previously uploaded.
Selecting a new picture as Feature Image, the previous one will be no longer the Post Thumbnail, been replaced by the new one.
Hoping you’ve enjoyed the reading. Drop me a line or comment below if you would like more details about the operation.