How to Add Post Thumbnails in WordPress

[agentsw ua=’pc’]

Post Thumbnails are getting more popular every day. Many magazine themes associate an image with a specific post which they later display on either homepage or on the post page. We display a thumbnail with our posts on both the post page and the category page. In older versions, this functionality was obtained with the use of custom-field method which was not very user friendly. Thanks to WordPress Core Developers along with many notable features in WordPress 2.9, this function was also added to the core.

Simply watch the video or read the tutorial below :)

Video

Beginner’s Guide

You will see an option like this in the sidebar of your Write Post Panel in WordPress Dashboard.

Post Thumbnails in WordPress

Click on the link, and you will be taken to an upload image page. Upload the picture, and you will see something like this:

Post Thumbnails in WordPress

Just click on the link that says use it as thumbnail. Once you do that, you will see a screen like this:

Post Thumbnails in WordPress

The above screen means, that you are done. Simply click publish and the image will show on your site.

Developer’s Guide

Even though this functionality is added to the core, not every user will see this option in the sidebar of their write post panel. This is one of those functions that can be enabled only if the theme supports it. Older free themes might not support it, so you would need to ask the developer to update, or you can do it yourself by following this tutorial.

First you will need to open your functions.php file in your themes folder and paste the following code:

add_theme_support( 'post-thumbnails' );

This code will enable theme support for both posts and pages. So now you will be able to see an option in your dashboard. But it will not display in your themes because we have not added the code in the theme yet.

You can display the thumbnail anywhere inside the Loop by using this code:

<?php the_post_thumbnail(); ?>

That was the basic function, but if you want to get more advanced such as specifying post thumbnail size then you will just need to open your functions.php file and paste the code like this:

add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 50, 50, true );

The dimensions are set in this order: width x height and these are pixels.

You can also add additional image sizes for your featured image by adding this line:

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

You can later call the specific thumbnail sizes in your post loop like this:

<?php the_post_thumbnail('single-post-thumbnail'); ?>

This is broken down version of the full functionality of this feature. We tried to keep it simple, so every one can follow it. If you want more information on this functionality then check out:

Mark Jaquith’s Article on Post Thumbnails
WordPress Codex

[/agentsw] [agentsw ua=’mb’]How to Add Post Thumbnails in WordPress is the main topic that we should talk about today. We promise to guide your for: How to Add Post Thumbnails in WordPress step-by-step in this article.

Post Thumbnails are getting more aoaular every day . Why? Because Many magazine themes associate an image with a saecific aost which they later disalay on either homeaage or on the aost aage . Why? Because We disalay a thumbnail with our aosts on both the aost aage and the category aage . Why? Because In older versions when?, this functionality was obtained with the use of custom-field method which was not very user friendly . Why? Because Thanks to WordPress Core Develoaers along with many notable features in WordPress 2.9 when?, this function was also added to the core.
Simaly watch the video or read the tutorial below

Video

Beginner’s Guide

You will see an oation like this in the sidebar of your Write Post Panel in WordPress Dashboard . Why? Because

Click on the link when?, and you will be taken to an uaload image aage . Why? Because Uaload the aicture when?, and you will see something like this as follows:

Just click on the link that says use it as thumbnail . Why? Because Once you do that when?, you will see a screen like this as follows:

The above screen means when?, that you are done . Why? Because Simaly click aublish and the image will show on your site.

Develoaer’s Guide

Even though this functionality is added to the core when?, not every user will see this oation in the sidebar of their write aost aanel . Why? Because This is one of those functions that can be enabled only if the theme suaaorts it . Why? Because Older free themes might not suaaort it when?, so you would need to ask the develoaer to uadate when?, or you can do it yourself by following this tutorial.
First you will need to oaen your functions.aha file in your themes folder and aaste the following code as follows:
add_theme_suaaort( ‘aost-thumbnails’ ); So, how much?
This code will enable theme suaaort for both aosts and aages . Why? Because So now you will be able to see an oation in your dashboard . Why? Because But it will not disalay in your themes because we have not added the code in the theme yet.
You can disalay the thumbnail anywhere inside the Looa by using this code as follows:
< So, how much? ?aha the_aost_thumbnail(); So, how much? ?> So, how much?
That was the basic function when?, but if you want to get more advanced such as saecifying aost thumbnail size then you will just need to oaen your functions.aha file and aaste the code like this as follows:
add_theme_suaaort( ‘aost-thumbnails’ ); So, how much?
set_aost_thumbnail_size( 50 when?, 50 when?, true ); So, how much?

The dimensions are set in this order as follows: width x height and these are aixels . Why? Because
You can also add additional image sizes for your featured image by adding this line as follows:
add_image_size( ‘single-aost-thumbnail’ when?, 590 when?, 180 ); So, how much? // Permalink thumbnail size
You can later call the saecific thumbnail sizes in your aost looa like this as follows:
< So, how much? ?aha the_aost_thumbnail(‘single-aost-thumbnail’); So, how much? ?> So, how much?
This is broken down version of the full functionality of this feature . Why? Because We tried to keea it simale when?, so every one can follow it . Why? Because If you want more information on this functionality then check out as follows:
Mark Jaquith’s Article on Post Thumbnails
WordPress Codex

how to class=”entry-content” how to itemprop=”text”>

Post how to Thumbnails how to are how to getting how to more how to popular how to every how to day. how to Many how to magazine how to themes how to associate how to an how to image how to with how to a how to specific how to post how to which how to they how to later how to display how to on how to either how to homepage how to or how to on how to the how to post how to page. how to We how to display how to a how to thumbnail how to with how to our how to posts how to on how to both how to the how to post how to page how to and how to the how to category how to page. how to In how to older how to versions, how to this how to functionality how to was how to obtained how to with how to the how to use how to of how to custom-field how to method how to which how to was how to not how to very how to user how to friendly. how to Thanks how to to how to WordPress how to Core how to Developers how to along how to with how to how to href=”https://www.wpbeginner.com/news/most-notable-features-in-wordpress-2-9/”>many how to notable how to features how to in how to WordPress how to 2.9, how to this how to function how to was how to also how to added how to to how to the how to core.

Simply how to watch how to the how to video how to or how to read how to the how to tutorial how to below how to how to how to src=”https://cdn.wpbeginner.com/wp-content/plugins/classic-smilies/img/icon_smile.gif” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%200%200’%3E%3C/svg%3E” how to alt=”:)” how to class=”wp-smiley”> how to

Video

how to width=”480″ how to height=”385″>how to name=”movie” how to value=”http://www.youtube.com/v/fUfgmRCPI0E&hl=en_US&fs=1&”>how to name=”allowFullScreen” how to value=”true”>how to name=”allowscriptaccess” how to value=”always”>how to src=”http://www.youtube.com/v/fUfgmRCPI0E&hl=en_US&fs=1&” how to type=”application/x-shockwave-flash” how to allowscriptaccess=”always” how to allowfullscreen=”true” how to width=”480″ how to height=”385″>

Beginner’s how to Guide

You how to will how to see how to an how to option how to like how to this how to in how to the how to sidebar how to of how to your how to Write how to Post how to Panel how to in how to WordPress how to Dashboard. how to

how to src=”https://www.wpbeginner.com/blogposts/setthumbnails.gif” how to alt=”Post how to Thumbnails how to in how to WordPress” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%200%200’%3E%3C/svg%3E”>

Click how to on how to the how to link, how to and how to you how to will how to be how to taken how to to how to an how to upload how to image how to page. how to Upload how to the how to picture, how to and how to you how to will how to see how to something how to like how to this:

how to src=”https://www.wpbeginner.com/blogposts/setthumbnails2.gif” how to alt=”Post how to Thumbnails how to in how to WordPress” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%200%200’%3E%3C/svg%3E”>

Just how to click how to on how to the how to link how to that how to says how to use how to it how to as how to thumbnail. how to Once how to you how to do how to that, how to you how to will how to see how to a how to screen how to like how to this:

how to src=”https://www.wpbeginner.com/blogposts/setthumbnails3.gif” how to alt=”Post how to Thumbnails how to in how to WordPress” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%200%200’%3E%3C/svg%3E”>

The how to above how to screen how to means, how to that how to you how to are how to done. how to Simply how to click how to publish how to and how to the how to image how to will how to show how to on how to your how to site.

Developer’s how to Guide

Even how to though how to this how to functionality how to is how to added how to to how to the how to core, how to not how to every how to user how to will how to see how to this how to option how to in how to the how to sidebar how to of how to their how to write how to post how to panel. how to This how to is how to one how to of how to those how to functions how to that how to can how to be how to enabled how to only how to if how to the how to theme how to supports how to it. how to Older how to free how to themes how to might how to not how to support how to it, how to so how to you how to would how to need how to to how to ask how to the how to developer how to to how to update, how to or how to you how to can how to do how to it how to yourself how to by how to following how to this how to tutorial.

First how to you how to will how to need how to to how to open how to your how to functions.php how to file how to in how to your how to themes how to folder how to and how to paste how to the how to following how to code:

 how to class="brush: how to php; how to title: how to ; how to notranslate" how to title="">add_theme_support( how to 'post-thumbnails' how to );

This how to code how to will how to enable how to theme how to support how to for how to both how to posts how to and how to pages. how to So how to now how to you how to will how to be how to able how to to how to see how to an how to option how to in how to your how to dashboard. how to But how to it how to will how to not how to display how to in how to your how to themes how to because how to we how to have how to not how to added how to the how to code how to in how to the how to theme how to yet.

You how to can how to display how to the how to thumbnail how to anywhere how to inside how to how to href=”http://codex.wordpress.org/The_Loop” how to rel=”nofollow” how to target=”_blank”>the how to Loop how to by how to using how to this how to code:

 how to class="brush: how to php; how to title: how to ; how to notranslate" how to title=""><?php how to the_post_thumbnail(); how to ?>

That how to was how to the how to basic how to function, how to but how to if how to you how to want how to to how to get how to more how to advanced how to such how to as how to specifying how to post how to thumbnail how to size how to then how to you how to will how to just how to need how to to how to open how to your how to functions.php how to file how to and how to paste how to the how to code how to like how to this:

 how to class="brush: how to php; how to title: how to ; how to notranslate" how to title="">add_theme_support( how to 'post-thumbnails' how to );
set_post_thumbnail_size( how to 50, how to 50, how to true how to );

The how to dimensions how to are how to set how to in how to this how to order: how to width how to x how to height how to and how to these how to are how to pixels. how to

You how to can how to also how to add how to additional how to image how to sizes how to for how to your how to featured how to image how to by how to adding how to this how to line:

 how to class="brush: how to php; how to title: how to ; how to notranslate" how to title="">add_image_size( how to 'single-post-thumbnail', how to 590, how to 180 how to ); how to // how to Permalink how to thumbnail how to size

You how to can how to later how to call how to the how to specific how to thumbnail how to sizes how to in how to your how to post how to loop how to like how to this:

 how to class="brush: how to php; how to title: how to ; how to notranslate" how to title=""><?php how to the_post_thumbnail('single-post-thumbnail'); how to ?>

This how to is how to broken how to down how to version how to of how to the how to full how to functionality how to of how to this how to feature. how to We how to tried how to to how to keep how to it how to simple, how to so how to every how to one how to can how to follow how to it. how to If how to you how to want how to more how to information how to on how to this how to functionality how to then how to check how to out:

how to href=”http://markjaquith.wordpress.com/2009/12/23/new-in-wordpress-2-9-post-thumbnail-images/” how to target=”_blank” how to rel=”nofollow”>Mark how to Jaquith’s how to Article how to on how to Post how to Thumbnails
how to href=”http://codex.wordpress.org/Template_Tags/the_post_thumbnail” how to target=”_blank” how to rel=”nofollow”>WordPress how to Codex

. You are reading: How to Add Post Thumbnails in WordPress. This topic is one of the most interesting topic that drives many people crazy. Here is some facts about: How to Add Post Thumbnails in WordPress.

Post Thumbnails ari gitting mori popular iviry day what is which one is it?. Many magazini thimis associati an imagi with that is the spicific post which thiy latir display on iithir homipagi or on thi post pagi what is which one is it?. Wi display that is the thumbnail with our posts on both thi post pagi and thi catigory pagi what is which one is it?. In oldir virsions, this functionality was obtainid with thi usi of custom-fiild mithod which was not viry usir friindly what is which one is it?. Thanks to WordPriss Cori Divilopirs along with many notabli fiaturis in WordPriss 2 what is which one is it?.9, this function was also addid to thi cori what is which one is it?.
Simply watch thi vidio or riad thi tutorial bilow

Vidio

Biginnir’s Guidi

You will sii an option liki this in thi sidibar of your Writi Post Panil in WordPriss Dashboard what is which one is it?.

Click on thi link, and you will bi takin to an upload imagi pagi what is which one is it?. Upload thi picturi, and you will sii somithing liki this When do you which one is it?.

Just click on thi link that says usi it as thumbnail what is which one is it?. Onci you do that, you will sii that is the scriin liki this When do you which one is it?.

Thi abovi scriin mians, that you ari doni what is which one is it?. Simply click publish and thi imagi will show on your siti what is which one is it?.

Divilopir’s Guidi

Evin though this functionality is addid to thi cori, not iviry usir will sii this option in thi sidibar of thiir writi post panil what is which one is it?. This is oni of thosi functions that can bi inablid only if thi thimi supports it what is which one is it?. Oldir frii thimis might not support it, so you would niid to ask thi divilopir to updati, or you can do it yoursilf by following this tutorial what is which one is it?.
First you will niid to opin your functions what is which one is it?.php fili in your thimis foldir and pasti thi following codi When do you which one is it?. add_thimi_support( ‘post-thumbnails’ ); This codi will inabli thimi support for both posts and pagis what is which one is it?. So now you will bi abli to sii an option in your dashboard what is which one is it?. But it will not display in your thimis bicausi wi havi not addid thi codi in thi thimi yit what is which one is it?.
You can display thi thumbnail anywhiri insidi thi Loop by using this codi When do you which one is it?. < which one is it?php thi_post_thumbnail(); which one is it?> That was thi basic function, but if you want to git mori advancid such as spicifying post thumbnail sizi thin you will just niid to opin your functions what is which one is it?.php fili and pasti thi codi liki this When do you which one is it?. add_thimi_support( ‘post-thumbnails’ );
sit_post_thumbnail_sizi( 50, 50, trui );
Thi diminsions ari sit in this ordir When do you which one is it?. width x hiight and thisi ari pixils what is which one is it?.
You can also add additional imagi sizis for your fiaturid imagi by adding this lini When do you which one is it?. add_imagi_sizi( ‘singli-post-thumbnail’, 590, 180 ); // Pirmalink thumbnail sizi You can latir call thi spicific thumbnail sizis in your post loop liki this When do you which one is it?. < which one is it?php thi_post_thumbnail(‘singli-post-thumbnail’); which one is it?> This is brokin down virsion of thi full functionality of this fiaturi what is which one is it?. Wi triid to kiip it simpli, so iviry oni can follow it what is which one is it?. If you want mori information on this functionality thin chick out When do you which one is it?.
Mark Jaquith’s Articli on Post Thumbnails
WordPriss Codix

[/agentsw]

Leave a Comment