New in WordPress 2.9: Post Thumbnail Images
Many WordPress themes, especially those with “magazine-like” layouts, use an image to represent each post. It might just be on the front page. It might be alone, or alongside an excerpt. Until now, there was no standardized way to do this. Many themes would require you to tediously enter a Custom Field with the value being the URL you wanted to use. Often you had to do cropping yourself. With WordPress 2.9, theme authors can easily enable Post Thumbnail selection UI and call those image using simple template tags.
![]()
First, in the theme’s functions.php, declare that your theme supports this feature. This will enable the UI in the WP Admin.
add_theme_support( 'post-thumbnails' );
That will enable Post Thumbnail UI for both Post and Page content types. If you’d only like to add it to one, you can do it like this:
add_theme_support( 'post-thumbnails', array( 'post' ) ); // Add it for posts add_theme_support( 'post-thumbnails', array( 'page' ) ); // Add it for pages
Simply remove the one you don’t want to support.
Next, you should specify the dimensions of your post thumbnails. You have two options here: box-resizing and hard-cropping. Box resizing shrinks an image proportionally (that is, without distorting it), until it fits inside the “box” you’ve specified with your width and height parameters. For example, a 100×50 image in a 50×50 box would be resized to 50×25. The benefit here is that the entire image shows. The downside is that the image produced isn’t always the same size. Sometimes it will be width-limited, and sometimes it will be height-limited. If you’d like to limit images to a certain width, but don’t care how tall they are, you can specify your width and then specify a height of 9999 or something ridiculously large that will never be hit.
set_post_thumbnail_size( 50, 50 ); // 50 pixels wide by 50 pixels tall, box resize mode
Your second option is hard-cropping. In this mode, the image is cropped to match the target aspect ratio, and is then shrunk to fit in the specified dimensions exactly. The benefit is that you get what you ask for. If you ask for a 50×50 thumbnail, you get a 50×50 thumbnail. The downside is that your image will be cropped (either from the sides, or from the top and bottom) to fit the target aspect ratio, and that part of the image won’t show up in the thumbnail.
set_post_thumbnail_size( 50, 50, true ); // 50 pixels wide by 50 pixels tall, hard crop mode
Now, you can make use of the template functions to display these images in the theme. These functions should be used in the loop.
has_post_thumbnail() returns true/false and indicates whether the current post has a manually-chosen Post Thumbnail (in the loop):
<?php
if ( has_post_thumbnail() ) {
// the current post has a thumbnail
} else {
// the current post lacks a thumbnail
}
?>
the_post_thumbnail() outputs the Post Thumbnail, if it exists (in the loop):
<?php the_post_thumbnail(); ?>
Those are the basics. How about some advanced stuff?
What if you want to use a small 50×50 hard-cropped image for the home page, but want to use a 400 pixel-wide (unlimited height) image on the post’s permalink page? You’re in luck. You can specify additional custom sizes! Here’s the code:
functions.php
add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 50, 50, true ); // Normal post thumbnails add_image_size( 'single-post-thumbnail', 400, 9999 ); // Permalink thumbnail size
home.php or index.php, depending on your theme structure (in the loop):
<?php the_post_thumbnail(); ?>
single.php (in the loop):
<?php the_post_thumbnail( 'single-post-thumbnail' ); ?>
That’s it! set_post_thumbnail_size() just calls add_image_size( 'post-thumbnail' ) — the default Post Thumbnail “handle.” But as you can see, you can add additional ones by calling add_image_size( $handle, $width, $height, {$hard_crop_switch} );, and then you use that new size by passing the handle to the_post_thumbnail( $handle );
If you want your theme to support earlier versions of WordPress, you’ll have to use function_exists() to keep from calling these new functions in those versions. I’ve omitted that code to keep these examples as simple as possible. Here would be the functions.php example with the wrapper code:
if ( function_exists( 'add_theme_support' ) ) { // Added in 2.9
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 50, 50, true ); // Normal post thumbnails
add_image_size( 'single-post-thumbnail', 400, 9999 ); // Permalink thumbnail size
}
There is one caveat for this feature in WordPress 2.9 — it only works fully for new image uploads. We can’t yet resize images on the fly, although I’m strongly considering it for a future version. If you call the template functions on a post that has a Post Thumbnail that was uploaded prior to your theme having declared the new sizes, you won’t be able to do hard-cropping, and the box-resize will be done in the browser. As a temporary solution, Viper007Bond has a great plugin that will go back and create missing image sizes for you: Regenerate Thumbnails.
I’m looking forward to see what kinds of sites you can build with this feature!


Thanks for all the details, this is exactly what I need for my theme.
Fernanda Gomez
December 23, 2009 at 5:14 am
[...] Mark has a thorough writeup on a new feature in WordPress 2.9 called post thumbnail images. Good news is, K2 1.0 comes built-in support out of the non-existing box. [...]
Post Thumbnail Images in K2 « K2
December 23, 2009 at 5:19 am
Awesome guide, this will be handy for my theme.
Andy
December 23, 2009 at 8:37 am
brilliant. see you at wordcamp atlanta!
John (Human3rror)
December 23, 2009 at 10:15 am
Thanks for the complete throwdown about this. I love this new feature and think it’s a great addition to the core. Thanks for explaining it!
Web Design by 314media.com St. Louis
December 23, 2009 at 12:42 pm
So glad you did a simply worded step by step breakdown on how to incorporate this. Thanks so much for the information and your hard work to incorporate this feature in WP 2.9.
It does seem a little clunky still in its interaction…maybe I missed it in some official WP promotion, why do we have to enable through the functiosn.php file? Why isn’t it just available automatically? Or would it be if the line was in the loop in the theme file?
Rotheblog
December 23, 2009 at 2:28 pm
We didn’t want people to be confused by a “Post Thumbnail” meta box that had no effect on their blog. By making it opt-in, it will only show up on themes that support it. It’s also not something I expect every theme to incorporate. It doesn’t make sense for all layouts (which is why it’s not in the Default theme — tried to fit it in, there, and it was kludgey).
Mark Jaquith
December 23, 2009 at 2:57 pm
Hmm. That definitely makes sense from that perspective.
I know I had some problems figuring out how to earmark the thumb for the post. I found the little link nestled below the image sizes.
I kind of expected the dialogue box to go away, but on a new upload you need to save changes…
What was the decision about the UI here? Where to put the link – how to use the existing media upload but integrate this feature?
Rotheblog
December 23, 2009 at 3:01 pm
nicce! thanks for the post… i’ve been looking for this
Revenue Robot
December 23, 2009 at 2:39 pm
Finally! 2.9 seems to really have its act together.
Matthew Praetzel
December 23, 2009 at 4:34 pm
Hi i have a question : i’m using this new feature and i set in function.php like example the size of image and the hard crop, but this one doesn’t work…
luca
December 23, 2009 at 6:33 pm
I also had grief, and no success, using this method for the sizings Mark. Both single and normal thumbs would register and display, but not seemingly working off the size declarations inside functions.php. Is there a common conflict that we should look out for …?
I eventually used the more force-feed method of declaring the sizes inline (directly in single.php and index.php), and it worked as expected.
this worked for me …
[single.php] the_post_thumbnail(array(500,300));
[index.php] the_post_thumbnail(array(250,150));
So I’m not sure what the problem is (although it’s most likely me). I tried everything including function and cache flushing.
(I found this method c/o: http://www.kremalicious.com/2009/12/wordpress-post-thumbnails/)
Cracks
December 23, 2009 at 9:16 pm
This was on new images, uploaded after adding the size declarations?
Mark Jaquith
December 25, 2009 at 3:48 am
I was able to make the_post_thumbnail(array(250,250)); work for me in a php code widget.
Eric
February 16, 2010 at 7:09 pm
Correct link for above comment: http://www.kremalicious.com/2009/12/wordpress-post-thumbnails/
Cracks
December 23, 2009 at 9:17 pm
[...] Og her har du nogle tekniske detaljer om hvordan du indbygger nye funktionaliteter i dine temaer så som image thumbnails. Det har Joost skrevet om her og Mark her. [...]
Wordpress 2.9 er udkommet. Vent til 2.9.1 med opdatering | Saugstrup.org
December 24, 2009 at 4:58 am
[...] [...]
New in WordPress 2.9: Post Thumbnail Images « Quantrinet's Blog
December 24, 2009 at 11:42 am
[...] [...]
New in WordPress 2.9: Posthumbnail Im Tages « Quantrinet's Blog
December 24, 2009 at 11:44 am
Thanks for post. It’s good idea
Süleyman Sönmez
December 24, 2009 at 1:46 pm
Hi, i am currently developping a plugin to aggregate rss and completly customize the dashboard. Images have a special place in that plugin.
How this new features will/could change the way rss are generated by wp ?
see screenshot of my not-yet-released plugin here :
http://www.mailpress.org/wiki/index.php?title=File:OnTheFly017.jpg
thanks for your answer
arena
December 25, 2009 at 5:08 am
I currently use a thumbnail plugin called:
Simple Post Thumbnails
It has an option for a default thumbnail (if one is not set).
Is there a way to have a default thumbnail be displayed if one is not set with the WordPress 2.9: Post Thumbnail Images?
Chas
December 26, 2009 at 3:25 am
am I missing something or those are NOT thumbnails but Resized images…
please advise,
thanks
I’m able to set images as thumbs when creating/editing posts,
then I manage to display them on the sidebar,
but when I right-click them to view the image, I see the full image,
thanks
pressword
December 26, 2009 at 12:52 pm
I have the same problem, but not for all images, just some. I’m trying to find a pattern, but I can’t see anything common about their aspects. I even tried downloading one of the images I had problems with, a jpg, make it a little bit smaller in gimp and save it in png without changing the aspect, and upload, but it still didn’t insert the 50×50 image, just the original.
Any tips? I had this problem on 4 out of 10 images on the site I was testing.
Here is an example of an images that wont scale
http://www.nrk.no/banden/wp-content/uploads/2009/11/olav-risa.jpg
Morten Skogly
March 12, 2010 at 2:43 pm
I think I found the pattern, the script creates thumbnails, but whenever the size of the created thumbnail is bigger than the original image, it simply uses the original image and resize it.
I might be wrong, but that’s what I’ve seen happening.
Jacob Guite-St-Pierre
April 7, 2010 at 6:28 pm
Hi Chas,
you can put an default thumbnail for each post without a thumbnail image through the “has_post_thumbnail()” function described by Mark.
You put “the_post_thumbnail();” in the if-Part and then hardcode the default thumbnail in the else-Part.
Greetz
Markus
Markus Pezold
December 26, 2009 at 1:05 pm
Awesome. Thanks.
Chas
December 31, 2009 at 3:05 am
do you have a sample code for this?
Here is my problem: I am currently running wp-o-matic on a channel theme.. The theme can generate on my old posts where the images are hosted in my space…
on the new posts which are scraped from rss feeds, i think the theme is not avail to generate the thumbs since the images are hosted somewhere else..
here is the code on the index.php to display the thumb.
ID, ‘thumbnail’, ‘alt=”‘ . $post->post_title . ‘”‘); ?>
I am looking for a way to display a default thumb is the theme is not avail to generate a thumb and i want to try ur suggestion, just dont know how to code it..
any help will do. thanks! ^_^
iskolares
January 14, 2010 at 11:25 am
7A33B4628B2A788BC43DC896EA5
BobyMlMan
December 27, 2009 at 2:58 am
[...] New in WordPress 2.9: Post Thumbnail Images at Mark on WordPress (tagged: wordpress tutorial todo ) [...]
Linkdump for December 27th at found_drama
December 27, 2009 at 9:04 pm
Post thumbnails can be used to create automatic navigation of child pages, too.
With a plugin ( http://www.wlindley.com/website/autonav/ ) you can display, for each child page of the current page, that page’s
* Title
* Post thumbnail
* Manual excerpt (description, like “teaser text”)
And that plugin will create various sized thumbnails. If you change from 150×130 to 200×150 in the admin screen once, all the navigation thumbnails on your entire site change automatically.
Thanks to the WP team for the fantastic post thumbnail feature!
William Lindley
December 28, 2009 at 10:01 am
[...] New in WordPress 2.9: Post Thumbnail Images « Mark on WordPress. Partagez cette page : [...]
Nouveauté wordpress 2.9 : Vignettes sur les articles ou pages | Les Wordpressiens - Spécialistes wordpress - by CNSX
December 28, 2009 at 10:06 am
[...] alcune accattivanti novità, tra cui il Post Thumbnail Images e inoltre -Funzionalità di annulla/”cestino” globale, che significa che se si cancella per [...]
AV Blog · WordPress 2.9 – Carmen
December 28, 2009 at 10:32 am
Hi everyone,
My name is Freddy and I’ve wasted nearly a month of my life on this place
I found it after being recommended by a few friends who have been hanging out here for quite some time.
I am a writer, graphics artist, photographer and just about anything else that comes up around the office. Aside from the above interests i’m really into scifi as I know that is so much more out there to be discovered, and a feeling that the universe is just teaming with life.
Well, I hope that I get to know more people here, share some experience and start learning. Have a greay day!
CaptainFreddy
December 28, 2009 at 3:03 pm
[...] Justin Tadlock:”Everything you need to know about WordPress 2.9’s post image feature” New in WordPress 2.9: Post Thumbnail Images Using The New Post Thumbnail Feature In WordPress 2.9 The Ultimative Guide For the_post_thumbnail [...]
Post_thumbnail in WP 2.9 | Beginwithanidea
December 28, 2009 at 6:27 pm
Awesome post!
Apparently I need to spend more time rifling through WP core as I totally missed the set_post_thumbnail_size() function. That is a really handy addition to the system.
Ryan
December 28, 2009 at 9:27 pm
Thanks for the pointer to Vipers plugin. I hadn’t taken notice until I came back to re-read your post for a project I’m working on at the moment.
Thanks again
Ryan
December 29, 2009 at 12:20 am
[...] Mark Jaquith, célèbre développeur de WordPress nous en dit plus sur la manière d’utiliser cette nouvelle fonctionnalité. [...]
L’hebdo WordPress | WordPress Francophone
December 29, 2009 at 2:57 am
Great post. I appreciate the help.
Hoods
December 29, 2009 at 6:24 am
[...] Mark Jaquith, célèbre développeur de WordPress nous en dit plus sur la manière d’utiliser cette nouvelle fonctionnalité. [...]
L’hebdo WordPress
December 29, 2009 at 9:30 am
great post! thanks
dowlie
December 29, 2009 at 10:31 am
I can only get WordPress to display square thumbnails. It lets me do the image editing and saves in the right aspect ratio, but in the Edit Post page sidebar and live on my site it appears as a square thumbnail no matter what.
spencerbeggs
December 29, 2009 at 1:48 pm
I figured out that a plugin I was using — More Fields — was causing some sort of jQuery error. I followed the instructions here to fix compatibility: http://wordpress.org/support/topic/343952
C. Spencer Beggs
January 16, 2010 at 6:59 pm
I have the same bug but I don’t have any plugin installed
Edouard Duplessis
February 28, 2010 at 7:35 pm
[...] Mark Jaquith, célèbre développeur de WordPress nous en dit plus sur la manière d’utiliser cette nouvelle fonctionnalité. [...]
L’hebdo WordPress : brèves, BuddyPress, WordPress 2.9
December 30, 2009 at 2:45 pm
Dude, this is awesome.
I’ve been using TimThumb, which is great, but a lot of people using my themes have crappy hosting that causes TimThumb to break.
Thanks so much for adding this!
THE MOLITOR
December 30, 2009 at 6:55 pm
It would be INSANELY AWESOME if the new image editing features in 2.9 applied to the thumbnails too
THE MOLITOR
December 30, 2009 at 7:12 pm
TOTALY! I’ve been googling/searching wordpress plugins database just to see if someone already made a plugin to do just that; thumbnail editing.
geekgirl
April 7, 2010 at 8:13 am
nevermind, just realized its possible in 2.9.2
just doesn’t delete the original thumbnail file
for instance, if ur thumbnail is called:
myimage-125×125.jpg
and u edit the thumbnail, wp will create an updated copy with the changes u made, named like so:
myimage-125×125-e8573489573.jpg
and it does this for all other images if u chose the radio button to edit all image sizes (and not only the thumbnail).. a bit of a waste of space if u plan on editing a lot of image files soon after uploading them (as the originals will never be used).
geekgirl
April 9, 2010 at 1:24 am
Not sure if there is an easier way but I had to figure out getting the thumbnails outside the loop and this is what I cam up with.
‘
$pages = get_pages(‘child_of=25&parent=25&sort_column=menu_order&sort_order=asc’);
$count = 0;
foreach($pages as $page) {
$thumbID = get_post_meta($page->ID,’_thumbnail_id’,false);
echo ” . $page->post_title . ”;
echo ”;
}
‘
Not sure if that code will display legibly.
The trick is to find the meta_value stored under “_thumbnail_id”, which is an array, where ID stores the attachement ID, then you can grab the attachment using that ID and the wp_get_attachment_url() function.
I will have to work on a simple function like get_post_thumb($ID) that should make that easier. But works for now.
Marty Thornley
December 31, 2009 at 2:49 am
great post! thank ytou
key ödemeleri
July 27, 2010 at 1:41 pm
Let’s try that again. Part got chopped off:
$pages = get_pages(‘child_of=25&parent=25&sort_column=menu_order&sort_order=asc’);
$count = 0;
foreach($pages as $page)
{
$thumbID = get_post_meta($page->ID,’_thumbnail_id’,false);
echo ” . $page->post_title . ”;
echo ”;
}
Marty Thornley
December 31, 2009 at 2:50 am
Sorry for the multiples, but it doesn’t like my code
Get the img url with this:
wp_get_attachment_url($thumbID[0]);
Then echo that as the image src
Marty Thornley
December 31, 2009 at 2:53 am
I used this and got the original uploaded image… but when I used the following, I got the dimensions I was expecting:
$thumb = get_post_meta($page->ID,'_thumbnail_id',false);$thumb = wp_get_attachment_image_src($thumb[0], 'post-thumbnail', false);
$thumb = $thumb[0];
echo $thumb;
Travis Seitler
February 24, 2010 at 5:17 pm
wow. at last it seems that i can get rid of the custom fields with image links in it
great one!
does anyone has this combined with NextGen gallery? It would be great to be able to pick a thumbnail from that gallery. (now only in core media library I can choose ‘Set as Thumbnail’)
hartlijn
December 31, 2009 at 7:12 am
great post! thanks
key ödemeleri
June 23, 2010 at 11:55 am
[...] By the way, if you'd like to know how to include post thumbnails in a WordPress theme, you can take a look at this guide on how to do it. [...]
Remove Extra Bloat For the New Year - Fantastic Web Design
January 2, 2010 at 5:45 pm
What if you want the thumbmnail to appear on the index.php but not on the single.php. I’ve implemented the code you’ve suggested within my functions file and within the loop of the index.pph file and it plonks a thumbnail on my main blog page which is what I’m after, but it also plonks the same thumbnail on the single blog post page – is there a way to disable this?
Evie Milo
January 3, 2010 at 3:15 pm
[...] Mark on WordPress | New in WordPress 2.9: Post Thumbnail Images [...]
WordPress 2.9: Post Thumbnail Images | gidibao's Cafe
January 4, 2010 at 7:51 pm
I’m running into an issue with 2.9 trying to get the thumbnail piece working that when I specify the add_theme_support( ‘post-thumbnails’ ); the ability to see / select any photos through the add image or media library (either ones from before the change or after). If I comment out the line they still exist.
Any suggestions?
Jamie O
January 4, 2010 at 9:53 pm
At first glance I thought this was going to make life much easier but I think it still needs some ironing out… Lets say I want the post image to be 630px wide on the single post and 200px wide on the index. If I upload a lovely crisp jpeg measuring 630px wide, on the single page the processed image(630 px wide not resized at all) looks very nasty and blurry. I understand that the main use of this is for thumbnails, but if it takes an image of the same size and renders it ugly as all hell I’m going to stick with timbthumb until this starts looking a little sharper.
James
January 4, 2010 at 10:24 pm
Disregard that! This is what I get for working late I suppose… CSS was stretching the image, I take it all back. Post thumbnails are the way to go!
James
January 4, 2010 at 10:30 pm
Hello,
On our blogs that already have many posts that were made with earlier versions of WordPress, how do we make all those posts use an image that is associated with that post? This is so we wont have to manually and pick a thumbnail for each post, that would be extremely time consuming.
Thank you!
Emi
January 5, 2010 at 12:11 am
I have the same question…
Dan J
February 21, 2010 at 12:21 am
I am having difficulty writing the HTML link code and having the thumbnail be a link to the post… Any suggestion with the code and making the thumbnail be a link to the post? Thanks.
Chas
January 5, 2010 at 3:02 pm
I found the answer regarding having the thumbnail link to the post on this webpage:
http://justintadlock.com/archives/2009/11/16/everything-you-need-to-know-about-wordpress-2-9s-post-image-feature
Chas
January 6, 2010 at 11:57 pm
same as the comment above. how do u grab the link code of the attached image? wont work if its inside an img tag.
CAMS
January 5, 2010 at 8:13 pm
[...] New in WordPress 2.9: Post Thumbnail Images [...]
Post Thumbnails in Wordpress 2.9 | BrianDart.net Blog
January 6, 2010 at 3:33 am
[...] Also its worth a note since wordpress is also now up to 2.9 release, the new feature of post thumbnails is very interesting, this article is worth a read. [...]
Wordpress k2 goes 1.0 | 8bit-Online
January 6, 2010 at 6:09 am
Been trying all day. Can’t, for the life of me, see the UI feature to add the thumbnail to the post.
I’ve added the following to my themes functions.php file:
Any help? I’m running 2.9.1
Could someone possibly post/link to a screen shot of it working in their build?
Thanks,
Lewis Dexter Litanzios
January 6, 2010 at 5:00 pm
I have the same question…
sbs sonuçları
July 27, 2010 at 1:42 pm
The code that should appear above: http://pastebin.com/m6fa96a7d
Thanks,
Lewis Dexter Litanzios
January 6, 2010 at 5:02 pm
Remove lines 4 and 5. You’re adding support for both, then just for posts, then just for pages (so now posts don’t have it). Just do it like in line 3 and it adds it for both. If you want to specify, pass in an array with all the ones you’re supporting it for.
Mark Jaquith
January 12, 2010 at 10:29 pm
Is there a return such as post_thumbnail for this?
Andrew Harbert
January 6, 2010 at 6:27 pm
have the problem like CAMS and Chas above. i want to link the thumb-image but it dont work!
Babel
January 6, 2010 at 7:16 pm
Is there an easy way to add rollovers to the thumbs?
Kenny
January 7, 2010 at 9:49 pm
I’m so happy that WordPress finally added this functionality. Thanks for the break down!
MediaMisfit
January 8, 2010 at 2:19 am
I added the code in my theme, but now I get this error:
Warning: Cannot modify header information – headers already sent by (output started at /nfs/c04/h03/mnt/64590/domains/albotas.com/html/wp-content/themes/atahualpa344/functions.php:3) in /nfs/c04/h03/mnt/64590/domains/albotas.com/html/wp-includes/pluggable.php on line 868
What does this mean?
brownkidd
January 8, 2010 at 4:38 pm
Delete the white space before and after the php tags
amy
February 16, 2010 at 2:25 am
Does anyone know of way to show the previous next links as a thumbnail of the post?
Chas
January 9, 2010 at 2:46 am
[...] 2009 saw WordPress 2.7, 2.8, and 2.9 in rapid succession. As the platform continues to evolve toward perfection, its ease of use now extends even further to developers as well as end users. My favorite feature of the latest installment, WordPress 2.9, has to be the native post thumbnails support. You can now select an image of any size to represent each post. You can then make many as many different sizes and croppings of this image as you like in your theme’s functions file, which you can then call in your templates. I see this as a revolutionary development for people who customize WordPress for the Portfolio crowd. Art gallery plugins will be able to take great advantage of this new feature as well. Note to developers: you have to enable this feature in your theme’s functions file before it will show in the user’s post page. Mark Jaquith has written a great guide to how WordPress’s new post thumbnails work. [...]
» WordPress: Best of 2009 and Trends of 2010 | The Pink Crow
January 9, 2010 at 10:02 pm
[...] feature is not turned on by default. Mark Jaquith explains how to add post thumbnail capability to any theme. I tried it and it works. (Well, at least on themes that didn’t use something else to create post [...]
January 2010 East Bay WordPress Meetup Notes | WordPress Asylum
January 10, 2010 at 5:00 pm
This is just fantastic! I’ve been waiting for this for a long time!
Pepijn
January 11, 2010 at 10:16 am
[...] avec les thumbnails de la 2.9, on peut tout faire [...]
Utiliser les vignettes avec WordPress 2.9 | Encre de Lune
January 11, 2010 at 10:49 am
[...] New in WordPress 2.9: Post Thumbnail Images « Mark on WordPress Brug indsættelse af thumbnails automatisk i indlæg og sider. Det har jeg savnet i ca. tre år, men spørgsmålet er, om jeg får tid til at rode med det. (tags: wordpress thumbnail tutorial howto) [...]
links for 2009-12-23 « Mark Thomas Gazels websted
January 11, 2010 at 3:43 pm
On my sites, when the thumbnail settings are different from the ones in the admin (media), they are not taken into account. Is it a bug or a feature ?
Marie-Aude
January 12, 2010 at 7:59 am
[...] Mark Jaquith: New in WordPress 2.9: Post Thumbnail Images [...]
Why Use Thumbnails – New Feature in WordPress 2.9 | Websites for Small Biz
January 12, 2010 at 3:58 pm
You rock man !
Luglio7
January 12, 2010 at 5:01 pm
So here’s a little issue I found. Hopefully I can explain it in a way that makes sense.
If I go to an old post and click on the “set thumbnail” link, and then go to my gallery to choose a photo that I have already uploaded for that post. Then when it creates the icon it scales it down to fit within the 100×100 parameters. But in my functions file I am telling it to hard code it and crop the image to exactly 100×100 pixels.
But if I take that same image, drag it to my desktop, re-upload it and choose “Set as thumbnail” then it will work for me. Is this some small glitch in WordPress?
Thanks.
kyle steed
January 12, 2010 at 5:26 pm
It only does hard crops for newly-uploaded images. That will likely be remedied in a future WordPress version (or you can use a plugin to go back and re-render the crops).
Mark Jaquith
January 12, 2010 at 10:25 pm
[...] 168, 168, true ); I got that from a post on Mark Jaquith's blog: http://markjaquith.wordpress.com/200…mbnail-images/ Personal blog | Twitter Menu plugin | CSS Generator | Premium Support | New plugin: Code [...]
the_post_thumbnail() with get_posts() - WordPress Tavern Forum
January 13, 2010 at 3:27 am
[...] New in WordPress 2.9: Post Thumbnail Images « Mark on WordPress [...]
Mes favoris du 11-01-10 au 13-01-10 » Gilles Toubiana
January 13, 2010 at 4:40 am
[...] New in WordPress 2.9: Post Thumbnail Images: Mark Jaquith looks at the new Post Thumbnail image options in WrodPress 2.9. [...]
Around the WordPress Community: WPMU Merger, Widgets, Custom Fields, Shortcodes | WordCast - Blogging news, WordPress help, WordPress plugins, WordPress themes, WordPress news
January 13, 2010 at 1:03 pm
Is it possible to remove or re-position the post thumbnail image that gets automatically added to the bottom of each post? I want to it show at the top of the post’s content, not below.
I can do this manually, but there’s still that thumbnail image at the bottom that gets automatically added in when using post-thumbnails.
Matthew
January 13, 2010 at 2:36 pm
[...] New in WordPress 2.9: Post Thumbnail Images « Mark on WordPress – [...]
Items of interest » Blog Archive » Bookmarks for January 14th from 10:47 to 15:07
January 14, 2010 at 12:15 pm
reposting…
Here is my problem: I am currently running wp-o-matic on a channel theme.. The theme can generate on my old posts where the images are hosted in my space…
on the new posts which are scraped from rss feeds, i think the theme is not avail to generate the thumbs since the images are hosted somewhere else..
here is the code on the index.php to display the thumb.
ID, ‘thumbnail’, ‘alt=”‘ . $post->post_title . ‘”‘); ?>
I am looking for a way to display a default thumb is the theme is not avail to generate a thumb and i want to try ur suggestion, just dont know how to code it..
any help will do. thanks! ^_^
iskolares
January 14, 2010 at 10:20 pm
scrape this…
got the answer.. the default thumb was set in functions so i just changed it..
iskolares
January 15, 2010 at 2:08 am
For former posts (ancient blogs), I have created a plugin which filters the_post_thumbnail function. If not WP 2.9 thumbnail exists, the plugin looks for the first image uploaded via the post (belonging to the post). Then if none is found, it scans the content for the first image fount in the content itself.
Information and download here : http://www.fairweb.fr/en/my-wordpress-plugins/fw-post-image/
Hope it helps.
Fairweb
January 15, 2010 at 7:17 am
[...] New in WordPress 2.9: Post Thumbnail Images [...]
How to Use Thumbnails in Wordpress | Tubetorial
January 15, 2010 at 3:20 pm
I was having problems with it displaying as a permalink and setting features such as title, class and alt. And in specific, setting the tile to the_title_attribute. Is there an easy solution?
Many thanks.
Erin
January 15, 2010 at 7:31 pm
@Fairweb – thanks.
Here is an update of what I have found. If you go to http://www.kremalicious.com/2009/12/wordpress-post-thumbnails/ it tells you that you can add a class, title and alt attribute.
However, I haven’t been able to get the class variable to work. I tried combining Mark’s with the class variable in this way:
the_post_thumbnail(‘single-post-thumbnail’, array(‘class’ => ‘pic fl’ ));
With no success. And I tried changing the CSS from .pic.fl img to .pic .fl with no success.
The only way I seem to be able to include everything is to:
<a href="” rel=”bookmark” title=”Permanent Link to “> $the_title_attribute )); ?>
But I thought the post thumbnail attribute would eliminate the need for all this. Btw, the array title attribute doesn’t work but it needs to be there for the a title attribute to work. Weird.
Erin
January 16, 2010 at 5:15 am
Sorry all my code didn’t display.
Basically I added div tags to add the class function, the link tag to assign the href to the permalink, title to the_title attribute and call the_post_thumbnail.
But I am hoping someone knows of an easier solution.
Erin
January 16, 2010 at 5:22 am
@Erin, my plugin does not do anymore than the core function appart from the fact that it takes the image source in different places. I’m sure the title attributes works, class works but not alt. Permalink do not seem to exist in the core function (I’d like it to).
I’ll check on my plugin if it can be better. If you have any suggestion on it, please leave a comment on the plugin page.
Fairweb
January 16, 2010 at 2:13 am
I found out that the alt attribute is actually the legend.
Fairweb
January 16, 2010 at 2:45 am
Thanks for the great write up! I’m super geeked about this new functionality, but seem to be hitting a roadblock. It seems as though it should be easy enough to get the caption/link/etc associated to the thumbnail, but I just can’t find *anything* on the web about how to go about doing this. I just need to be patient I suppose, with this being so new and the documentation not even being complete yet. Thanks again for the great article!
Kieran Smith
January 16, 2010 at 4:14 pm
I’m not sure what you’re asking but if sounds like the post thumbnail is not being associated with the post. Check that you are putting it inside the loop.
If you’re trying to add the permalink then see my comment above. I’ve had to write it in a similar way to how you would call a theme integrated hack.
Erin
January 16, 2010 at 5:12 pm
Hi there, this is a great feature, and one that has a great deal of potential. If I can offer a suggestion:
The images in my blog are all watermarked, and have a border around them. Cropping them to a fixed size will create an odd looking thumbnail. So my suggestion is to allow the image to be cropped *before* resizing, so that a border and/or watermark can be removed from the image before it is resized for the thumbnail.
…Mike
MikeD
January 16, 2010 at 5:37 pm
Thanks Mark, great post – had thumnails working in no time
… but… I was excited about using this feature in my new theme, but I have run into a problem in that the hard crop function crops from top & bottom, or from sides.
It would be so fantastic if, in future versions, you could select the crops for thumbnails (a la facebook profil pics for example) or at least select to crop from top left, or crop from center, or crop from bottom right etc…
Do you think the functionality is likely to be extended to offer us more control over the cropping of thumbnails?
Frank Prendergast
January 16, 2010 at 6:20 pm
that’s a really helpful feature and I would love to use it.
However, like Frank Prendergast and boylogik stated before, it would be really great to have options from where to crop.
Is there some hope for a feature like that in the near future?
Birgit
March 13, 2010 at 2:37 pm
[...] New in WordPress 2.9: Post Thumbnail Images [...]
res4WP | WordPress Tips & Tricks, Tutorials: Using Post Thumbnail In WordPress 2.9
January 16, 2010 at 8:19 pm
[...] New in WordPress 2.9: Post Thumbnail Images « Mark on WordPress (tags: howto development tutorials wordpress 2.9) [...]
Digital Distractions | links for 2010-01-17
January 17, 2010 at 9:04 am
[...] Mark Jaquith’s Article on Post Thumbnails WordPress Codex [...]
How to Add Post Thumbnails in WordPress
January 18, 2010 at 9:07 am
Thanks Mark, great stuff here. I have a few questions if you have the time.
Is it possible to add more than one of the post thumbnail boxes to the editor screen?
Can the location it appear in be modified?
Can the title given the box be changed?
Can a paragraph of text be added to give instruction on its usage? (below the box for example)
I want to use this for an attorney website project I am working on- the image will be used as the various attorneys profile pics on their profile page. These attorneys are most definitely NOT confident around websites and I need to make it as easy for them to use as possible.
Being able to change the location and title of the post thumbnail box and add some instructive text would go a long way to making this easier for them. I am used to working with metaboxes (which of course allow me to easily do all of the above) But I am not sure how to achieve similar results with this post-thumbnail-box.
I appreciate you may not have time to answer in detail, but if you could point me to some documentation (couldn’t find anything in the codex) it would be helpful.
Many thanks!
Ash
Ash
January 19, 2010 at 9:58 am
WordPress Theme: Unwakeable 1.5.3…
Unwakeable 1.5.3 is available for download. This version is built off K2 1.0.3 and should work beautifully with WordPress 2.9+. You can head over to the Unwakeable page to get the download, or you can grab it here. K2 1.0 added more support for WordPre…
T. Longren
January 19, 2010 at 4:41 pm
Today is my birthday and what I’d really like is to understand custom fields. Some say it’s easy and some say otherwise. I tried following your post, but I’m still not clear. Can you point me to an easy to understand beginner’s tutorial? Is there a definitive source for custom fields? I’ve search with Google and read post after post and WP’s own codex, but still need more. Thanks!
David H
January 19, 2010 at 11:52 pm
happy birthday
you can fill a custom field when you write a new post. and when you want to display this entry (in the code of you theme) you can use this field to display this post different or do something else. its easy if you understand it
Babel
January 20, 2010 at 3:56 am
Hi,
Thanks for the great tutorial! I’m having a problem though and was hoping someone may have the answer! I have followed Mark’s directions to the letter and everything works fine except it will not hard crop. Yes, I know the image has to be newly uploaded, and I have tried a million test posts with different images, but works great, except for hard crop, any suggestions?
Thanks!
Tracy
January 20, 2010 at 5:32 pm
Comprehensive tutorial. Helped me out a lot today.
Thanks.
sidouglas
January 20, 2010 at 8:41 pm
Thank you very much. I have been developing a site for a couple of months, got stuck on thumbnails (didn’t want to use a plugin), went on holiday for six weeks, came back and gosh darn it you went and included the functionality in the core! Much needed and much appreciated – thanks!
mummybot
January 21, 2010 at 10:11 am
[...] You may read more about activating the thumbnail functionality for your theme for example here. [...]
kolamilch.com » admin thumbnails plugin for wordpress
January 21, 2010 at 11:29 am
In my opinion, the 2 most important questions for developers are:
1) If you define multiple handles (say 10 different image sizes) in functions.php, does wordpress generate all 10 sizes upon upload even though you may only use only 3 or 4 of the handles for that post within your theme? If so, that will slow down processing time and makes for a giant increase in files / storage. So DOES WP GENERATE ALL 10? or only when that post is utilized within the theme? How do I check this?
2) Hard crop doesn’t seem to work. And as stated above, it would be ideal to specify from what point to crop (i.e., from top left, or crop from center, or crop from bottom right etc)
Anyone know the answers? Thanks in advance guys / gals.
boylogik
January 21, 2010 at 12:19 pm
I’m not a coder, so I may be way out of line asking about this, but I can’t wrap my head around the thumbnails code. I used the “Regenerate Thumbnails” plugin to get the size I wanted, but I’m not sure exactly what code to paste in functions.php or where to put it. I have the custom field in my UI, but I thought WordPress was now generating thumbnails automatically.
Something’s supposed to go in the loop, but I’m not sure what that means either.
brianmacdonald
January 22, 2010 at 9:50 am
Thanks for the great tutorial! It was the perfect introduction to the_post_thumbnail.
I implemented on a theme of mine, and I am now facing a small issue:I would like to display the caption of the image below it. Is there an array to call the caption when calling the_post_thumbnail?
Jeremy
January 22, 2010 at 11:40 am
This forum is alive? If yes, please remove this topic and my account.
thineeeffer
January 22, 2010 at 7:34 pm
My test this forum number 2. trfekiol
eagestype
January 23, 2010 at 6:24 pm
Would also love to have get_the_post_thumbnail…
Frank Prendergast
January 24, 2010 at 9:45 am
Apologies – what I meant to post was I’d love to have access to the thumbnail url…
I did find this relevant support ticket:
http://wordpress.org/support/topic/344886
Frank Prendergast
January 24, 2010 at 9:55 am
I can re-crop the thumbnail in the image editor and it displays the right way in the media gallery, however, when I select “Use as thumbnail” the image added to the thumbnail — both in the Edit Post panel and live on the site — is the thumbnail as it was originally generated. Regenerating the thumbnails with the plugin doesn’t seem to help. Oddly, everything works fine for cropping regular-sized photos.
C. Spencer Beggs
January 24, 2010 at 2:19 pm
[...] Post Thumbnail Images « Mark on WordPress “Many WordPress themes, especially those with “magazine-like” layouts, use an image to represent each post. It might just be on the front page. It might be alone, or alongside an excerpt. Until now, there was no standardized way to do this. Many themes would require you to tediously enter a Custom Field with the value being the URL you wanted to use. Often you had to do cropping yourself. With WordPress 2.9…” (tags: wordpress tutorial howto theme development webdesign webdev 2.9 thumbnail) Posted by Ogo No Comments yet, your thoughts are welcome » [...]
links for 2010-01-24 - Ogo
January 24, 2010 at 5:06 pm
[...] Post Thumbnail Images on WordPress 2.9 – [...]
180 enlaces seleccionados, enero 2010 | Vectoralia
January 27, 2010 at 12:30 pm
[...] Mark Jaquith’s Article on Post Thumbnails WordPress Codex [...]
Shopper4.com Sites — Blog — How to Add Post Thumbnails in WordPress
January 27, 2010 at 1:25 pm
[...] basics go like this. Check out Matt’s post and also visit Mark Jaquith’s and Kremalicious‘ posts on the subject for more [...]
WordPress 2.9 Thumbnails - Curtis Henson
January 27, 2010 at 8:41 pm
[...] http://markjaquith.wordpress.com/2009/12/23/new-in-wordpress-2-9-post-thumbnail-images/ [...]
Wordpress Post Thumbnail « Yellowecho.com
January 28, 2010 at 4:43 am
Prior to stumbling on this article, I wrote my own meta box for post thumbnailing. It shows default thumb in the meta box, then when you click on it, brings up media library window where you can choose actual image, then when thickbox closes it substitutes default image in meta box with one that has been chose.
After I found out that there is default feature for this in wp 2.9, I though woa, what a waste (my job that is), but then when I activated it and looked at new default meta box, first thing that came to my mind was – maybe it’s broken? What’s the point of a link in metabox just bringing up media library window and then inserting thumb not in a hidden field or something, but into the editor? What if I do not want a thumb do be there, should I delete it manually? And why it is not shown in the meta box itself?
Or maybe, it’s just broken in my case?..
Davit
January 29, 2010 at 3:12 am
Thanks for the clearly written, step-by-step instructions for those of us who break our blogs nearly every time we try to follow instructions written for professional coders. This worked the very first time, and that never happens!
Erica M
January 29, 2010 at 4:53 pm
Omg! I spent three months learning WordPress and its implementation of OOP from the ground up and pulled my hair out trying to get images working properly. Then this comes along, just as I finish my project!
My next project is coming along nicely, and I’ve managed to very easily slot the functions into the main funciton file and the theme function file.
You’re a hero mate.
Chris
January 30, 2010 at 5:30 pm
[...] of you are aware of the recent WordPress 2.9 release, which includes the feature to include/use post thumbnails. Currently, StudioPress “classic” themes are using an image-resizing script called TimThumb, [...]
5 (Really Good) Reasons to Build Your Site With Genesis | Links to Wordpress
January 31, 2010 at 12:42 am
[...] Jaquith, a lead developer on WordPress sheds some light on this new feature. He provides the necessary fundamentals and understanding required to get Post Thumbnails working [...]
Test with the true 150×113 function | Betatown
February 1, 2010 at 12:58 am
[...] plugin automatically assigns thumbnails to posts using the Post Thumbnail Interface introduced in WordPress [...]
Post Thumbnail Plugin
February 2, 2010 at 12:23 am
Great, exactly what I was looking for!
Shahar
February 2, 2010 at 6:01 am
Thanks Mark … I have been trying to figure out what should I do for displaying all the blog post images as thumbnail if I want to redesign … You save my day
Myo Kyaw Htun
February 3, 2010 at 4:28 am
doesn’t work on 2.9.1
anon
February 3, 2010 at 11:01 am
Is there some kind of magical mystery I am not getting on using the POST THUMBNAIL to actually link to a bigger image of itself, and/or the actual post?
I hacked at the code in my ARCHIVE and INDEX and wrapped an ANCHOR with the permalink tags and now when I click on the thumbnail it takes me to each post.
But I want the singlepost page to, when clicked on, open the full-sized image. Is this possible? How?!
PLEASE?!
This seems like it would be a given, but sheesh I am going crazy here.
Eric S
February 3, 2010 at 9:09 pm
By the way, what I did that worked for linking the image to the post is as follows:
<a href=""> "alignleft post_thumbnail")); } ?>
Eric S
February 3, 2010 at 9:14 pm
Sorry it cut my code up
Eric S
February 3, 2010 at 9:15 pm
WELL CRAP! Sorry,
Eric S
February 3, 2010 at 9:15 pm
[...] Mark Jaquith’s Article on Post Thumbnails WordPress Codex [...]
MySite4.ws — Blog — How to Add Post Thumbnails in WordPress
February 4, 2010 at 4:54 am
Please see my blog. I can’t use Post Thumbnail facilities in post editing. The image is inserted into the post, but the thumbnail isn’t change.
I follow the instruction from http://protomondo.com/2010/01/19/post-thumbnails-arthemia/ based on this post, but no anything happened. The thumbnail is not load in my site.
Somebody help me…
MossackAnme™
February 4, 2010 at 11:15 am
Are you clicking the USE AS THUMBNAIL link on the post thumbnail image upload option?
Do you have the function.php file updated?
What version of WP are you using?
Eric S
February 4, 2010 at 11:24 am
I use WP 2.9.1, and I updated function.php in my theme like the instructions. The USE AS THUMBNAIL button isn’t load in my Post Thumbnail facilities, I don’t see it in “From URL” tab. What’s happened? It’s only load in “Media” tab, not in “From URL” tab.
Can I use an external image url as my post thumbnail without upload it into my server? I use free image hosting such as Photobucket etc. to host my images.
MossackAnme™
February 4, 2010 at 12:35 pm
When you go into a post, on the far right side near bottom, is the POST THUMBNAIL widget there?
WHen you are into that item, you can use GALLERY, UPLOAD, MEDIA LIBRARY and FROM URL
Eric S
February 4, 2010 at 1:04 pm
Yes, I know it, I must use Set Thumbnail through POST THUMBNAIL widget, right?
If we wanna choose an image as thumbnail, we click on USE AS THUMBNAIL option, right?
The problem is: I couldn’t find USE AS THUMBNAIL option at FROM URL tab, I only found it at MEDIA LIBRARY tab. So, I can’t use an external image url as post thumbnail.
Do you understand my problem?
Can I use an external image url (FROM URL tab) instead of MEDIA LIBRARY as my post thumbnail? I need that condition because I use external image hosting like Photobucket.
MossackAnme™
February 4, 2010 at 2:04 pm
Yeah, ok, just did a walkthrough.
Same here, the option only shows up for USE AS THUMBNAIL on the FROM COMPUTER and MEDIA LIBRARY, not the USE URL
Why don’t you do a local save of the images you need to use for the thumbnail. That is the only thing I can think of right off.
Eric S
February 4, 2010 at 2:23 pm
Great new feature for 2.9 Mark
In 2.8 we’d needed a secondary thumbnail size with the ability to auto generate if not existing, and fall back to a default img if there was no attachment associated with the post at all. I called them post toenails and used the intermediate_image_sizes filter and some fresh code to put it all together.
Looking forward to plugging this new stuff in and taking it for a spin
Lee Newton
February 4, 2010 at 5:13 pm
Yeah the POST THUMBNAIL is pretty good, I am just at a loss why you cannot easily make a link to the post or image itself.
I figured out the link to the post, but not sure why cannot get the file.
I think the images adding height and width to the end is messing up my “trial” at this.
Eric S
February 4, 2010 at 6:19 pm
Hmm…
I use limited server space, so I need to use a minimal amount of filesize in my server.
Do you know what the best way to compress an image without loosing too much image quality? I converts my pictures from *.jpg and *.png into *.gif but it’s not too significant.
- If I use MediaLibrary, the function.php is converts the image with resize or crop? How each way works?
- How about if I upload a an image that has width-height below the minimal width-height in function.php? What’s the consequences?
MossackAnme™
February 4, 2010 at 9:21 pm
I personally prefer to use jpeg for pics and png for graphics. I just adjust my slider in Photoshop when saving but usually try for around 70%-60%
check out the post thumbnail template file in the wp-includes for some of the info. But I think up there is some info on hard cropping and such with the images.
Eric S
February 5, 2010 at 12:13 am
Ok, thanks Eric!
May this dialog can build our future collaboration.
\(^o^)/
MossackAnme™
February 5, 2010 at 7:20 pm
I hear ya Mossack!
I am new to WP but not programming and web, so this is a learning thing for me too.
The postthumbnailtemplate php file should/might have that info.
I am trying to get the thumbnail function to not throw that sizing tag on the end. I think that is why I cannot get the image to link itself to a bigger size image
Eric S.
February 5, 2010 at 8:00 pm
I upload my thumbnail that has 300x275px size. So the resize/crop function isn’t do anything to that image. See at my http://www.mossackanme.web.id/tutorial/ and do right-click on my headline thumbnail, the image URL should the image itself (not followed by the cropped size).
Another idea : How can I make Featured post list as slideshow like Arthemia Premium? I have more than 4 Featured post, but only 4 of them is diplayed on my homepage.
MossackAnme™
February 6, 2010 at 11:24 pm
It does not look like you have the jQuery carousel running? Are you using the same exact featured effect?
On the Arthemia theme it has a jQUery carousel and it has the function called in the code too. I don’t see it on yours right off?
For the Post Thumbnail cropping, do you have the one simple theme support call in your function.php file?
That is all I had to do and it does the cropping
Eric S.
February 6, 2010 at 11:43 pm
I wanna integrate it into my wp, but not yet success.. ^^ Any simpler way?
I don’t see any “carousel” in my Arthemia Free, but integrate it from Arthemia Premium to the free one is seems difficult…
MossackAnme™
February 7, 2010 at 6:54 pm
I do see on the theme itself the items are set up in an unordered list and your items are not in an ul with
applied to it?
Eric S.
February 7, 2010 at 8:30 pm
Hmm…need an emergency help…
Please see my http://www.mossackanme.web.id/tutorial/
My blog title is same at every pages! Whoaaa…
I don’t know what’s happened…
Can you help me?
I’ve added some code to show 5 colorfull category on the sidebar like ArthemiaPremium. Send me a blank e-mail to mossack [dot] anme [at] gmail [dot] com and I’ll send you my sidebar.php.
MossackAnme™
February 8, 2010 at 5:51 am
The file sent to your email.
I need your help, my blog title become same at every pages after I edited this sidebar.php
MossackAnme™
February 9, 2010 at 1:02 am
[...] New in WordPress 2.9: Post Thumbnail Images [...]
bbunker » T2010020501
February 5, 2010 at 5:42 am
<div style="background:url('
ID, ‘_thumbnail_id’);
echo(wp_get_attachment_url($thumbid[0]))
?>
‘) top left no-repeat”>
Works fine to insert post_thumbnails as backgrounds!!
Thks by the post and comments by @Marty Thornley
Eder Lima
February 5, 2010 at 11:08 am
This DIV code is to put the image behind your post?
Eric S.
February 5, 2010 at 8:02 pm
information is very helpful me:) thank you for his info
blogtutorial
February 5, 2010 at 9:11 pm
[...] Mark Jaquith’s Article on Post Thumbnails WordPress Codex [...]
How to Add Post Thumbnails in WordPress « About-Better-Blogging
February 12, 2010 at 8:28 am
I’m having the same problem as Tracy. Hard-cropping does not work for me – it just does the standard box-resize.
Digging into the code, it doesn’t seem like there’s any place where any cropping is actually going on. I’d expect one of the functions to call image_resize() but I honestly do not see the code anywhere. From waht I can tell it just calls the intermediate resize function which basically box-resizes it.
cary
February 12, 2010 at 10:06 pm
Did you look in the post thumbnail template file? I have not looked at it yet, but just came across that file a week or so ago..may help, I dunno
Eric S
February 12, 2010 at 10:12 pm
[...] galleries also contain posts, pages, other galleries, and pictures? With the new post thumbnail interface introduced in WordPress 2.9, this could be a very powerful addition to a [...]
Who Says WordPress Galleries Should Only Contain Pictures
February 13, 2010 at 4:04 am
[...] which give you the full lowdown and this new feature. The first is from WordPress Lead Developer, Mark Jaquith who provides the basics to get you up and running in a few minutes. The second is from Jason [...]
Easily add post thumbnails using native wordpress functionality in your theme | themesforge.com - Premium Wordpress Themes, News, TIps and More
February 14, 2010 at 7:05 pm
Great article Mark.
I wrote a follow up article on our experiences with this method here:
http://themesforge.com/wordpress/add-new-native-wordpress-post-thumbnails-to-your-theme/
Ed
February 14, 2010 at 7:10 pm
Thanks so much. This tutorial goes into such great detail!
Vira
February 15, 2010 at 2:24 am
[...] created the code using the new Post Thumbnails feature in WordPress, and a custom WordPress loop. The code will display the latest 5 posts that have been tagged [...]
Featured posts display for Komplett blog
February 15, 2010 at 1:10 pm
Thank you for this post! (and thank Ed for linking to it JUST YESTERDAY!)
ancawonka
February 15, 2010 at 9:34 pm
[...] method is depreciated in favor of the wordpress 2.9 thumbnail functionality. Here is a good tutorial how to implement [...]
UPDATE:function to extract image as thumbnail from a post – rhizom
February 16, 2010 at 12:02 pm
Mark: Are there any plans to implement a feature where you can choose multiple thumbnails for a post/page? I was hoping that was possible with this new feature, but it seems it’s not. I think it could be really useful on some themes. Thanks!
Kate
February 16, 2010 at 2:36 pm
[...] your theme supports native thumbnails (introduced in WordPress 2.9), you will be able to change them by double-clicking on [...]
Version 1.7 | scribu
February 17, 2010 at 9:39 pm
Hi, I love your step-by-step directions. I just edited a blog for a client: http://bit.ly/cat2Ye (shortened the url) but the home page layout adjusted drastically to show only a snippet of each post and no image. How can I incorporate thumbnails (on a separate page – not the home page) AND keep my original layout?
Please help
, high-traffic blog and now it’s stuck (I’m wary of deleting all my new code with hopes that I can ‘fix’ the issue to keep thumbnails too)
Thanks!
Morgan
February 18, 2010 at 4:25 pm
[...] All posts using the new “post thumbnail” feature in 2.9, [...]
V-for-Veronica » Incoming Blog Changes
February 18, 2010 at 10:00 pm
Hi Mark,
Thanks for the detailed breakdown on th thumbnail function and feature now available in wordpress. I have added this all into a new theme I am working on and its working great… when I have selected a thumbnail in the post.
I had some problems creating a default thumbnail to appear on the index when no thumbnail had been selected but got round this but for the life of me I cannot seem to make the default thumbnail link to the post title where it is being called.
Building of this statement If –> Else I got an image to appear but cant get it to link to the post title. Anyone able to help at all? Here is the code I was messing with
http://pastebin.com/f5b80d5e
Justin Parks
February 20, 2010 at 8:26 pm
Try this:
http://adeptris.pastebin.ca/1812560
I just use withing the div the <a href and it works fine.
<a href="” >
David
Digital Raindrops
February 26, 2010 at 8:02 pm
[...] New in WordPress 2.9: Post Thumbnail Images « Mark on WordPress [...]
Segnalibri al 20.02.2010 ‹ Ubuntu block notes
February 21, 2010 at 4:58 am
[...] of you are aware of the recent WordPress 2.9 release, which includes the feature to include/use post thumbnails. Currently, StudioPress “classic” themes are using an image-resizing script called [...]
5 (Really Good) Reasons to Build Your Site With Genesis
February 21, 2010 at 11:49 am
[...] of you are aware of the recent WordPress 2.9 release, which includes the feature to include/use post thumbnails. Currently, StudioPress “classic” themes are using an image-resizing script called [...]
5 (Really Good) Reasons to Build Your Site With Genesis — StudioPress
February 21, 2010 at 2:27 pm
[...] feature is not turned on by default. Mark Jaquith explains how to add post thumbnail capability to any theme. I tried it and it works. (Well, at least on themes that didn’t use something else to create post [...]
WordPress 2.9 Feature Overview: Jan 2010 Meetup | WordPress Asylum
February 21, 2010 at 9:57 pm
[...] post é uma adaptação traduzida do post original de Mark Jaquith, que me ajudou a implementar esta nova funcionalidade num projecto recentemente.) Posted in [...]
Como adicionar miniaturas nos posts do seu blog
February 23, 2010 at 9:52 am
Hello, as you can see this is my first post here.
Hope to receive some assistance from you if I will have some quesitons.
Thanks in advance and good luck!
electro
February 23, 2010 at 3:47 pm
where are the functions for this located in core? Is there a filter for it?
Mark Parolisi
February 23, 2010 at 5:54 pm
[...] restored (THX to Simone Fumagalli) – Resize automatic after the upload (THX to Simone Fumagalli) – Post Thumbnail [...]
NextGEN Gallery Version 1.5.0 beta 1 at alex.rabe
February 24, 2010 at 5:02 pm
Congratulations about your post, really.
It is very detailed and about a new feature!
Helped me a lot.
I was just wondering if there is a way to configure that the default thumbnail of posts uses the thumb image of wordpress with default size. I believe WordPress will improve that if it isn`t already working that way
Luisa Ambros
February 25, 2010 at 9:00 am
Congratulations about your post, really.
It is very detailed and about a new feature!
Helped me a lot!
I was just wondering if there is a way to configure that the default thumbnail of posts uses the thumb image of wordpress with default size. I believe WordPress will improve that if it isn`t already working that way
Luisa Ambros
February 25, 2010 at 9:00 am
[...] post has been created based on a post by Mark Jaquith here and we would like to thank mark for making the code easy to [...]
Adding Post Images
February 26, 2010 at 6:23 pm
[...] thumbnail code in this ‘free theme’ was created based on a post by Mark Jaquith here and we would like to thank mark for making the code easy to [...]
CMS-Portfolio Theme
February 27, 2010 at 11:35 am
thanks Guy
Toni
February 27, 2010 at 5:25 pm
There are better solutions like this:
http://www.sebastianbarria.com/thumbgen/
peivem
February 28, 2010 at 11:36 pm
Nice and easy to follow tutorial, thanks!
Semut Design
March 2, 2010 at 12:57 pm
Wow, it is about time they add this tag to wordpress. It is sooo useful. I have always used the custom fields to achieve the post thumbnail affect, I will for sure be using this one in my next project.
Wordpress Template Tags
March 2, 2010 at 4:43 pm
[...] out Mark Jaquith’s article for more detail on the usage of the thumbnail function. Damien Oh is the owner and [...]
Snippet: Adding Post Thumbnail in WordPress 2.9 – Make Tech Easier
March 3, 2010 at 2:01 pm
[...] New in WordPress 2.9: Post Thumbnail Images « Mark on WordPress – Wie man ab WP 2.9 Thumbnails für Posts nutzen kann [...]
Netzfundstücke vom 4.3.2010 | EGM Weblog
March 4, 2010 at 4:06 am
“There is one caveat for this feature in WordPress 2.9 — it’s only works fully for new image uploads. We can’t yet resize images on the fly, although I’m strongly considering it for a future version”
It would be great! actually I create a new website (available but not communicated). Visitor are able to create their own post (with TDO-mini form). I use theme similar to this one : http://www.studiopress.com/demo/lifestyle.html. It uses thumbnails for post in home page and big thumbnail for the “fetured content”. Actually i try with Post Thumb Revisited. It’s working but i take to much time to process (without it my home takes less than 1 sec to load, with it more than 4 sec.
I fact on the fly it checks if the thumbnail already exists for the posts, if not it parses the posts for image or video and create the thumbnail on the fly or put the default image (normal or video default image).
If it can be doned at core level with a lightweight manner it will be great. For now i cannot release my new website because it takes too much to load the page.
Do you think Mark, this will be in the next release of WordPress (3.0) ?
Regards, Joan.
ps: TDO-mini-Form works too but too heavy (without it 27 SQL queries at home page, with : 838 SQL queries!! . It adds 4 sec on the home page load! even if TDO-mini form is only used in a dedicated page
veda
March 4, 2010 at 7:39 am
Hey did you activate caching and/or downloa WP Super Cache? That might fix load times.
J
Justin
May 19, 2010 at 4:52 pm
I need to do something like this:
if ( has_post_thumbnail() ) {
the_post_thumbnail();
} else {
$thumb = getFirstImagefromPostandResize ();
set_post_thumbnail($thumb);
the_post_thumbnail();
}
getFirstImagefromPostandResize it’s ok code already available based on plugin.
I need to know how to do for this kind of function in wordpress : set_post_thumbnail($thumb)
in order to store my automatically generated thumbnail
and reuse it transparently with the_post_thumbnail() without passing by manual GUI uploader (set thumbnail);
Do you know how to do it? which function i have to call in wordpress?
thank you very much for your answers.
veda
March 4, 2010 at 9:33 pm
I need to do something like this:
if ( has_post_thumbnail() ) {
the_post_thumbnail();
} else {
$thumb = getFirstImagefromPostandResize ();
set_post_thumbnail($thumb);
the_post_thumbnail();
}
getFirstImagefromPostandResize it’s ok code already available based on plugin.
I need to know how to do for this kind of function in wordpress : set_post_thumbnail($thumb)
in order to store my automatically generated thumbnail
and reuse it transparently with the_post_thumbnail() without passing by manual GUI uploader (set thumbnail);
Do you know how to do it? which function i have to call in wordpress?
thank you very much for your answers.
veda
March 4, 2010 at 9:34 pm
great post! thanks for info
Brian Smith
March 5, 2010 at 12:03 am
[...] New in WordPress 2.9: Post Thumbnail Images ~ Mark Jaquith : I favor doing it this [...]
10 Most Common Wordpress Posts | New 2 Wp
March 7, 2010 at 1:04 am
[...] Vía | Mark Jaquith [...]
Agregar nuevo tamaño de imágenes a Wordpress
March 8, 2010 at 6:04 pm
Does this tag only work with images that are uploaded using the built-in media uploader? What if the images are uploaded via FTP to a folder on the same server, but outside of wp-content?
Arun
March 8, 2010 at 9:01 pm
[...] New in WordPress 2.9: Post Thumbnail Images – Mark Jaquith [...]
SongSpace – Free WordPress Theme | Theme Lab
March 9, 2010 at 9:30 am
[...] New in WordPress 2.9: Post Thumbnail Images – Mark Jaquith [...]
wordpress dev » Blog Archive » SongSpace – Free WordPress Theme
March 9, 2010 at 10:17 am
[...] Also checkout another post onWP2.9 post-thumbnails. [...]
Notes from Day Two of WordCamp Ireland | Steve Flinter
March 10, 2010 at 5:03 am
great article, thanks for sharing.
clark
March 10, 2010 at 7:24 pm
To show thumbnail or medium images just I’ve made my own query based on get_posts($args) and wp_get_attachment_image()
The code:
$image_post = array (
‘post_type’ => ‘attachment’,
‘numberposts’ => 1,
‘post_status’ => null,
‘orderby’ => ‘ID’,
‘order’ => ‘ASC’,
‘post_parent’ => $post->ID );
$attachments = get_posts ( $image_post );
if ($attachments) {
foreach ( $attachments as $attachment ) {
$img = wp_get_attachment_image ( $attachment->ID, $size = ‘thumbnail’, $icon = false );
echo $img;
}
}
Example: http://www.recetaecuatoriana
Daniel
Daniel Calisaya
March 10, 2010 at 10:58 pm
Sorry the example correct is: http://www.recetaecuatoriana.com
Daniel Calisaya
March 10, 2010 at 11:00 pm
[...] First, in the theme’s functions.php, declare that your theme supports this feature. This will enable the UI in the WP Admin. view source [...]
Post Thumbnail Images on WordPress 2.9
March 12, 2010 at 4:11 am
I too can show the “re-sized” images but it should be pointed out that these are merely the original image (re-sized in dimensions, not file size) which retains the original file size.
If you have a page full of these “thumbnails” then you are loading a lot of data.
Shouldn’t you include some sort of phpThumbs image re-sampling etc based on something such as the php DG library?
Rob
March 12, 2010 at 5:54 am
[...] New in WordPress 2.9: Post Thumbnail Images « Mark on WordPress Posted March 12th, 2010 in Blog by Gareth http://markjaquith.wordpress.com/2009/12/23/new-in-wordpress-2-9-post-thumbna…; [...]
New in WordPress 2.9: Post Thumbnail Images « Mark on WordPress | [codepotato]
March 12, 2010 at 8:24 am
Thanks a lot for all the details!
I’ll add thumbnail images on my blog theme soon.
giapox
March 13, 2010 at 5:53 am
im like it so much
smartwordpress
March 13, 2010 at 7:57 pm
I’m using fancy box to show for the gallery. So I do use the_post_thumbnail(‘medium’); as the thumb and I would like to have the_post_thumbnail(‘full’); as the link in
So that when the user click the small (thumbnail picture) the full size picture will be shown.
However, I can’t the way to get the url of full size image.
I did try this:
ID, ‘large’);?>
<a title="" href= "”>
but it doesn’t work
mangajin
March 13, 2010 at 9:22 pm
Hi everybody !
I was trying to show thumbnails in my post excerpts.
I’m trying to get the easiest and more authomatic way for showing them.
This is my plan: to show a thumbnail with the same name as the post id + jpg (or gif or so on).
Does anybody know what should I do for getting it?
Thanks a lot in advance !
Javi A.
March 14, 2010 at 7:02 am
Hi Mark,
I have the merci theme from http://newwpthemes.com/wordpress-theme/merci/
I tried to read you use your guide but got lost. Can you tell me what I need to do to get thumbnails to appear in the featured secrion ? Thanks a million ,
Anthony
Anthony
March 14, 2010 at 12:10 pm
The featured section on the NewWPThemes are actually done by going into the Themes Option under APPEARANCE and then clicking and choosing the category you want to use.
The function sets up temporary images in a folder in JDGALLERY in the slides images folder. But change the category from SELECT to a category and it will be setup
Eric S
March 14, 2010 at 1:07 pm
Hi Mark,
I have the merci theme from http://newwpthemes.com/wordpress-theme/merci/
I tried to read you use your guide but got lost. Can you tell me what I need to do to get thumbnails to appear in the featured section ? Thanks a million ,
Anthony
Anthony
March 14, 2010 at 12:11 pm
[...] Todo sobre las miniaturas (thumbnails) de WordPress 2.9 Mark Jaquith: New in WordPress 2.9: Post Thumbnail Images Justin Tadlock: Everything you need to know about WordPress 2.9’s post image feature Comparte [...]
Nuevo en Wordpress 2.9: Miniaturas de Entrada (Post Thumbnails) | emenia.es
March 15, 2010 at 5:48 pm
hey I can’t add this new feature on wordpress sites hosted on windows server 2003, iis6, php 5.3.2, wordpress 2.9.1. I get no thumbnail UI on post editor page and if I use “the_post_thumbnail();” function i get errors. I successfully use the same code and themes on a linux server. Any ideas why this may be.
kwaku
March 16, 2010 at 6:23 am
[...] with 225 comments [...]
Insight » Blog Archive » Here is a new post!
March 16, 2010 at 10:58 am
[...] 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 CodexSimilar PostsHow to Display Post Excerpts in WordPress ThemesMost Notable Features [...]
How to Add Post Thumbnails in WordPress | Best Web Magazine
March 16, 2010 at 3:24 pm
Hi. Thanks for the walkthrough (and allllll of your contributions!).
I am trying to use this method to add a thumbnail, but when clicked, I want to use the “rel=”lightbox” to evoke the lightbox plugin for the larger version (say the single page sized-version). In order to do that, I must link to the image.
I have tried adding something like
<a href="” rel=”lightbox”>
but of course the_post_thumbnail( ‘single-post-thumbnail’ ) includes much more than just the image name.
Please help.
casey troy
March 16, 2010 at 6:32 pm
Troy, did you ever get an answer to this -or- figure it out? I would like to do the same exact thing. I would appreciate any guidance.
Thanks
Randy
March 23, 2010 at 1:55 am
[...] WordPress v2.9 Post Thumbnail Images – easily enable thumbnail selection ui [...]
3 WordPress Plugins That Improve User Experience. Easy, Simple, Saves Time
March 17, 2010 at 2:02 pm
I am having a problem getting the thumbnail to show in my child theme “Gallery.” Here is the string I have in the functions.php file to have my thumbnails show on the home page.
here is a link to the demo site: http://www.reinnovating.com/yourbusiness/
I’ve also tried {the_post_thumbnail();} instead of {get_the_post_thumbnail();} and cannot get the thumbnails to show
Any ideas?
Angel
March 19, 2010 at 8:30 am
I’ve used this feature to make a custom template for a failblog. Implemented for both images and videos extensively. Site can be found at http://www.failorfunny.com
However, I used the default thumbnail sizing technique rather than hardcoding it. Thing is, I made that theme when WP2.9 just came out. I wish this post was out earlier. Defining multiple thumbnail attributes is just so much easier!
TheLimeDesign
March 21, 2010 at 11:13 pm
Hi,
I have followed your tut but am still having trouble!?
This is my code: functions.php
add_theme_support(‘post-thumbnails’);
set_post_thumbnail_size( 564, 206, true );
index.php:
‘alignleft’ )); ?>
But..the image still does not take on these dimensions? I think the image is keeping in proportian..?
It is 206px high but does not stretch to 564px wide?
Please help.
PS The site is not live yet.
Thanks
Huw
March 22, 2010 at 7:45 am
My thumbnails work perfectly fine, the problem I am having is that two images are showing up on category pages like such: http://prevailpr.com/category/how-to/
This does not happen on individual post pages, nor with static pages.
Any ideas on how I can stop this from happening?
Aaron
March 22, 2010 at 3:55 pm
I have not been able to play with the code lately, but was wondering:
Does anyone know how to make the THUMBNAIL a link to the full size image and not just the post?
I have the thumbnail setup to link to the post on most pages, but on the actual singlepost I just want to have the image linked to a full size image.
Eric S.
March 22, 2010 at 4:12 pm
thanks dear for help
Muhammad Azhar
March 23, 2010 at 3:22 pm
Wow- thats a lot of comments!
Thanks for creating this guide dood – its really helpful.
Sooo much easyer to configure than a whole bunch of broken thumbnail plugins out there.
Your explanations and language are easy to read. thanks
Ricky Synnot
March 24, 2010 at 6:02 am
Is anyone else as dumb as me and gets both the thumbnail and the fullsize image in the front page post and the single post?
Help!!
TIA
Ian
March 24, 2010 at 7:00 am
Thanks so much for this, just getting to grips with WordPress and this is an ideal guide to add thumbnails.
Nice one.
Sam C
March 24, 2010 at 2:18 pm
Will there be customized thumbnails cropping capability in the next update? I’ve resorted to regenerate my own thumbnails since currently the thumbnail generation seems to favor the middle part of an image.
Lee
March 26, 2010 at 11:20 am
[...] (note for additional options see here) [...]
Create a grid layout for a wordpress category | Dx3webs
March 28, 2010 at 5:07 pm
[...] Quellen: Onextrapixel, Mark on WordPress [...]
WordPress 2.9: Post Thumbnails verwenden « pehbehbeh
March 29, 2010 at 11:53 am
Hello everybody,
I’m originally from the USA. and I am fresh inside this website.
I’ve chozen the username morSoymbozy due to the fact it entails a letter from each particular person from my spouse and children,mother, father and brothers. As it is possible to see I have a rather big spouse and children whom I love most. I thank them everyday for putting up with me.
My real name is Andrea, Nice to meet you all.
Simply just popped in to say hello to everybody. This can be my 1st time here and I encounter it all as highly remarkable!!! I’m as new a newbie as they arrive about the world wide web but I’m so glad I found this website where I consider I can talk and study with other people right here during the community.
I have three wonderful kids, two girls and a boy. The girls are both 9 and my boy is 12. I was blessed adequate to receive them with my partner whom I adore deeply.
I am searching forward to seeing us all grow like a community and to become taking part as significantly and as fine as I individually can.
Regards,
morSoymbozy
morSoymbozy
March 30, 2010 at 7:00 am
[...] First, in the theme’s functions.php, declare that your theme supports this feature. This will enable the UI in the WP Admin. view source [...]
New in WordPress 2.9: Post Thumbnail Images « Wordpress Tips and Tricks
March 30, 2010 at 7:24 am
Hey very nice blog!! Man .. I will bookmark your blog and take the feeds also…
Russia
March 30, 2010 at 1:00 pm
I’m new to wordpress. Is there a way to search for themes that support this great feature? Excellent writeup by the way.
Wes
March 30, 2010 at 1:58 pm
Iv used the thumbnail function on a few sites and it works great. I’ve run into one issue though, well not really an issue. Let me explain.
I’m using the thumbnail tag on an index page for two sections that use two different size images. One needs to have a specific size image and the set_post_thumbnail_size works for this, but it also re sizes the second thumbnail. Is there a way to decipher between the two sections?
Thanks.
Brent
March 31, 2010 at 2:42 pm
Great article! Quick and easy so I just forwarded it to a couple of friends and clients.
Thanks
Jacob Guite-St-Pierre
March 31, 2010 at 5:08 pm
I’m beating myself for having just opened an account here at DP after all these years. (I know right? Where have I been!?)
Wendihorse
April 2, 2010 at 6:48 am
Since adding Thumbnail support my WordPress gives blank screen on saving of any post or theme editing.
When I go back through from the dashboard, the changes are there – only for the problem to happen again on next edit.
If I remove add_theme_support(‘post-thumbnails’); from functions.php the problem disappears.
Please help!!
Thanks,
Michael
MichaelC
April 2, 2010 at 7:51 am
Quick addition: WordPress continued to do the blank screen until I deleted the test page I had created with a thumbnail.
Also – to make sure the problem wasn’t a conflict with a plugin, all had been deactivated.
So what’s going on?
I’m REALLY keen to use the feature – but I can’t when its like this.
Thanks in advance,
M
MichaelC
April 2, 2010 at 8:41 am
thanks Mark, It’s so useful -dario
dario brozzi
April 2, 2010 at 3:20 pm
Hello Everybody,
I am new member right here
I not long ago found this place and so far i have found lots of great info right here.
I’m looking forward to connecting and contributing to the forum.
Floaloume
April 3, 2010 at 3:26 pm
hi anybody,
I am new here within a forum. My actual name is Jeanine Dulore. It can be nice to meet you all. I’m a the mother of four children and better half to a fantastic partner Mike. I’m looking forward to take part in the forum.
OptileFit
OptileFit
April 4, 2010 at 12:14 am
Therefore , how will youcelebrate this particular Easter Holiday?
daviduxresll
April 4, 2010 at 11:30 am
[...] http://markjaquith.wordpress.com/2009/12/23/new-in-wordpress-2-9-post-thumbnail-images/ VN:F [1.8.7_1070]please wait…Rating: 0.0/5 (0 votes cast) Share and Enjoy: [...]
Wordpress Post Thumbnails « Wordpress « Compuhowto.com
April 8, 2010 at 5:14 pm
Hi.
I think that the thumbnail function is just great.
I’m using it to show a thumbnail of the child pages on a parent page. It is a website with a lot of content and images.
And my problem is:
I have a problem showing the thumbnails of all the children pages on a parent page.
From the page source I can see that the child pages are listed on the HTML, but for some reason there are always only 15 thumbnails per parent page, even though there are more children pages.
And it’s always 15 thumbnails per page. Where I can change this? Is this somekind of a default?
I’ve been struggling with this for a couple of days now. So help would be much appreciated!
Jenny
April 8, 2010 at 5:43 pm
[...] additional thumbnail formatting and detailed parameters I love the guides by Mark on WordPress and WPEngineer.com very [...]
Wordpress: Add Thumbnails; Wrap Text Around Thumbnails : delOmni – Home for geeks
April 11, 2010 at 11:46 am
Mark,
Awesome new feature. This is going to save so much time fooling with custom fields and uploading images.
Drew
April 11, 2010 at 7:15 pm
Great tip, just used this for the featured posts section on my Chinesehacks.com website, very useful!
analogue40
April 12, 2010 at 10:17 am
Great article, and the only place (other then possibly by reading the proper documentation) which covers creating multiple sizes of the same image – Just what I needed
Damian Jakusz-Gostomski
April 12, 2010 at 3:11 pm
[...] WordPress 2.9 came out, one of the touted features was the “official” support for post thumbnails. Instead of storing URLs in custom fields, a new method with an easy UI was added. This is great [...]
WordPress 2.9 has Thumbnail Support. What Does This Mean for Existing Themes?
April 14, 2010 at 7:54 am
Great post, thanks for you help! I’ve referred to your code about a dozen times for various projects in the last few weeks. Finally gotten around to documenting myself so I don’t have to keep coming back!
One thought though – the example you use is a perfect square (50×50). For noobs it might be worth changing that to 50×75 so it’s easier to tell which is height and which is width in your examples.
BrenFM
April 14, 2010 at 7:17 pm
True, but he does mention this…
add_image_size( $handle, $width, $height, {$hard_crop_switch} );
Which should tell even n00bs where to put their details
Will A.
April 15, 2010 at 8:25 pm
[...] the Blue Cross website this afternoon. Was working on adding a thumbnail to each post using this method, but had limited success. As you can see from the screenshot, I’ve still got my rather [...]
Thursday, April 15th, 2010 – Post 2
April 15, 2010 at 6:59 am
This was really helpful for my blog, thanks!
Mirco
April 15, 2010 at 2:08 pm
Compelling! On the phone a scintilla tough to understand, but advantage it!
Myspace
April 15, 2010 at 3:40 pm
Interesting observation. Only infrequently is it truthful it is.
Myspace
April 15, 2010 at 3:54 pm
Not perfectly caught some moments, but generally entertaining
Myspace
April 15, 2010 at 3:56 pm
I have it working…sorta. I’m totally stuck and there seems to be a lack of documentation on the Codex for this feature so here goes.
The small 160×160 thumbnail for article listings/search views works fine. It crops it, all’s groovy. The issue comes when I go to format the image for the single.php article details view. It crops, but then scales down even further for some reason.
Screenshot:
http://c1319072.cdn.cloudfiles.rackspacecloud.com/4-15-2010%204-56-46%20PM.png
NOTE: every time I re-test this I’m completely deleting the image from the media section and re-uploading the image entirely. I also have the re-create thumbnails plugin so I know it’s not caching.
Will A.
April 15, 2010 at 8:14 pm
I meant to include my code. This will help in debugging.
add_theme_support( ‘post-thumbnails’ );
set_post_thumbnail_size( 160, 160, true ); // Normal post thumbnails
add_image_size( ‘single-post-thumbnail’, 618, 150, true ); // Permalink thumbnail size
Will A.
April 15, 2010 at 8:15 pm
resourcesinsuranceduluthga
jemhqr
April 15, 2010 at 10:15 pm
I just search a wordpress plugin that can easily enable Post Thumbnail in my Home Page. Have any solution?
Lightofearth
April 16, 2010 at 12:23 pm
I just search a wordpress plugin that can easily enable to view post thumbnail in the Home page
Lightofearth
April 16, 2010 at 12:25 pm
[...] which give you the full lowdown and this new feature. The first is from WordPress Lead Developer, Mark Jaquith who provides the basics to get you up and running in a few minutes. The second is from Jason [...]
I saw this in a picture.
April 16, 2010 at 4:50 pm
[...] If you just want post thumbnails, WordPress has that built in. (See http://markjaquith.wordpress.com/2009/12/23/new-in-wordpress-2-9-post-thumbnail-images/) [...]
March 2010 Meetup Q & A
April 17, 2010 at 2:05 am
[...] then be easily shown in your blog using a simple function. Mark Jaquith has written an excellent blog post explaining this new feature in detail, do read it if you are wondering how to get started or why [...]
[Wordpress Plugin] Automatic Post Thumbnail at SANIsoft – PHP for E Biz
April 18, 2010 at 11:21 pm
[...] you need a thumbnail or image to go with each post. Newer versions of wordpress have a post thumbnail capability built in, but I didn’t want to use that as I wanted to pull in thumbnails from outside the [...]
Shayera.com, Your Hawk Girl Source! » Blog Archive » Featured Posts Banner
April 19, 2010 at 2:12 pm
Is there any way to access the path of one of these images instead of having it output an image tag? I need specifically the path itself…nothing more.
We’re intending to pass it into flash via a flashvariable and need the path instead of the actual image tag. I could strip it out via strstr() but that’s messy and could break later with a WordPress core upgrade.
Right now we’re using:
Will Ashworth
April 19, 2010 at 7:33 pm
Sorry, it stripped out my sample code. Here’s what we’re using currently…
the_post_thumbnail(‘some-special-size-here’);
Will Ashworth
April 19, 2010 at 7:34 pm
I found that parsing the URL out works, but it’d be great if WordPress could add built-in functionality to grab just the URL instead of forcing us to use the IMG tag.
http://polymathworkshop.com/shoptalk/2010/03/19/get-the_post_thumbnail-direct-path-for-wordpress/
Will Ashworth
April 19, 2010 at 8:22 pm
[...] do not have the ‘Post Thumbnail’ option available to you it will need to be enabled, Mark Jaquith has a good article for doing this on his web [...]
Adding a Wordpress Post Thumbnail
April 20, 2010 at 5:19 am
“What if you want to use a small 50×50 hard-cropped image for the home page, but want to use a 400 pixel-wide (unlimited height) image on the post’s permalink page? You’re in luck.”
What happens if you want to use a different image for the thumbnail (a teaser so to speak) and then a different image for the permalink? Could you please tell me how to do it?
Jimmy
April 20, 2010 at 6:23 am
[...] Source: For more details and options on Enabling Post Thumbnail Images, check here. [...]
Make Your Theme WordPress 3.0 Compatible
April 20, 2010 at 6:32 pm
[...] http://markjaquith.wordpress.com/2009/12/23/new-in-wordpress-2-9-post-thumbnail-images/ [...]
Mary's Wordpress Plugins · Wordpress plugin Generate Post Thumbnails v0.4.1 was released
April 20, 2010 at 6:55 pm
I really liked this feature, and wrote a plugin “Generate Post Thumbnails”, that will automatically generate post thumbnails using post images. I hope this will be helpful as it was for me with my already existing blog posts.
http://wordpress.org/extend/plugins/generate-post-thumbnails/
Maria Shaldybina
April 21, 2010 at 7:57 pm
Would anyone happen to know why I cant get this working for Page thumbnails? I’m trying to list child pages using this code. (the 2nd one, in ‘post format’). Switched out all instances of ‘content’ with ‘excerpt’ and used Andrew Oz’s Excerpt Editor which is seriously cool.
When I try to plug in the code for the thumbnail, it doesn’t show.
Any idea what I might be doing wrong?
Trisha
April 21, 2010 at 8:10 pm
sorry about the somewhat random question. I thought it was a thumbnail issue, but it was the php on the template page… this code works if anyone is trying to display child pages with an excerpt & thumb: http://wordpress.org/support/topic/297090
Trisha
April 22, 2010 at 7:22 pm
Did I thank you already for this excellent tutorial? After years of having to resize&upload every single pic featured on my main page I can finally do it the easy way. Thanks a lot!
halibutt
April 22, 2010 at 8:33 am
Great post
Thanks alot
Dat Tai
April 22, 2010 at 5:43 pm
[...] with 292 comments [...]
KC-DHV.ORG » Blog Archive » of the image won’t show up in the thu
April 23, 2010 at 1:46 am
kiss – keep it simple and stupid
i really like the way u explain everything in snippets!! So much more efficient than those markup’d and overdosed examples!!!
I tried to change the media folder to “wp-content/uploads/%category%/%postname%/” like the post-permalink setting. What happend i got 2 folder with the names %category% and %postname%, is there a way to make this happen or will it be supported someday?
Any idea why in the media library deleted images still are in the file system?
Fahrschule
April 23, 2010 at 4:25 pm
Great … I added your code into functions.php and it screwed up my wordpress editor and the function of my theme.
Ray
April 24, 2010 at 12:07 am
I’ve been having really good luck with it. What’s WordPress doing exactly on your install? Can you paste your code so we can see if maybe there’s a typo?
Will
April 24, 2010 at 12:21 am
Ray, double check to see if there are any extra line spaces in the functions.php file where you pasted the code. That’ll throw double header errors. Take out the spaces and try again.
Trisha
April 24, 2010 at 8:30 am
Wow what a thread!
Okay I have been trying to figure this thing out with no luck. Here is my problem. I have an autoblog that uses wp robot plugin. The plugin post images, but does not save them to the server. Which I like because its one less image to host. However the problem that I am running into is that on magazine type themes; the thumbnails for amazon,articles,youtube,and yahoo answers do not show up on the front page or in the sliders of themes like solostreams wp clear or woo themes gazette or the arras theme.
I have tried the get image plugin to no avail. is this possible to make this happen?
Thanks
Sam Johnson
April 24, 2010 at 3:40 pm
Will this work on an autoblog?
The WP Robot plugin does not download the images to the server. So I am not sure how to make this work.
Anyone use WP Robot?
Sam Johnson
April 24, 2010 at 10:41 pm
Hey,
Thnx for this great article it is really usefull!
Murfix
Matthisk
April 25, 2010 at 10:27 am
[...] tags. More information about how use post thumbnails and adjust their default sizes can be found at Mark Jaquith’s tutorial on the [...]
Daily Tip: Enable Post Thumbnails in Your WordPress Theme - WordPress MU and BuddyPress plugins, themes, support, tips and how to's
April 25, 2010 at 4:18 pm
[...] tags. More information about how use post thumbnails and adjust their default sizes can be found at Mark Jaquith’s tutorial on the [...]
msn
April 26, 2010 at 2:47 pm
Thank you! =)
JP
April 27, 2010 at 1:44 pm
Hey Mark, I’m very fond of using this support add-on. But I have a problem which you may like to help me out here.
Currently, only Authors (user role) can upload new photos using the Post Thumbnail panel. As in this case, Authors can write posts and submit without moderation of the Admin when he/she publish it.
However, I like to build a site with this scenario. A Contributor can write the post and at the same time use the Post Thumbnail panel (powerful thing) to upload new photos.
He/she can then click the Submit For Review button for the Admin to moderate, approve and later publish the post.
Currently, the problem is that Contributor could not make use of the Post Thumbnail panel.
Is there a way to tweak this or allow Contributors to use this powerful feature?
Look forward to your solution, Mark! Cheerz!
Yahya Ayob
April 29, 2010 at 12:39 am
Hi, Im using videoflick 2.2 theme and I uploaded the thumbnails normally using the simple thumbnail uploader on the home tab. They worked. Yesterday i lost my blog url address and got locked out of my own website thankfully managed to get it back and now the thumbnails are gone. Whenever I try to upload a thumbnail it refreshes and says ‘ Post Updated’ but the thumbnail doesn’t work. Any ideas?
nigag
April 30, 2010 at 9:14 pm
excellent
Thanks alot ,Pro
Dat Tai
May 2, 2010 at 5:33 pm
[...] 这样就OK啦,不算太难吧,稍微发散一下思维就不难想到,缩略图的作用还不止于此,N久N久以前我介绍的用自定义域给每篇文章添加的缩略图也可以淘汰了,Wordpress 2.9 的 post thumbnails 缩略图功能完全可以替代自定义域添加的图片,而且方便简单,自定义程度更高,在和尘埃大哥合作的新主题中也有用到这招,帅呆了。有兴趣的想扩展一下的朋友可以继续参考这篇文章。 [...]
Wordpress 免插件实行图片相关日志 » Life Studio
May 4, 2010 at 9:15 am
[...] the long run it might be better to use the thumbnails built into WordPress. However, the caveat there is you will need to regenerate the different image sizes after setting [...]
Mod TimThumb for WPMU and Thesis — kristarella.com
May 4, 2010 at 11:23 pm
[...] 这样就OK啦,不算太难吧,稍微发散一下思维就不难想到,缩略图的作用还不止于此,N久N久以前我介绍的用自定义域给每篇文章添加的缩略图也可以淘汰了,Wordpress 2.9 的 post thumbnails 缩略图功能完全可以替代自定义域添加的图片,而且方便简单,自定义程度更高,在和尘埃大哥合作的新主题中也有用到这招,帅呆了。有兴趣的想扩展一下的朋友可以继续参考这篇文章。 [...]
Wordpress 免插件实现图片相关日志 » 科技博客
May 5, 2010 at 12:08 am
hey, I’m trying to get this new feature to work, and I can get it to display the images just fine, however I need to just get the URL as the image styling etc is handled somewhere else.
I’m trying to get the Post Thumbnail to work with the YARPP plugin, and I need to be able to retrieve only the URL of the post thumbnail. I did see some code somewhere in this section on how to do it, but it’s giving me a complete headache!
Any tips?
uno
May 6, 2010 at 8:30 pm
Spasibochki for writing! Used to write home.
NimDouff
May 7, 2010 at 9:08 pm
Thanks for the tips bro.
Amal Roy
May 8, 2010 at 11:47 pm
[...] the addition of post thumbnails in WordPress 2.9, developing news and magazine style sites is so much easier. Prior to post [...]
Using Post Thumbnails On StudioPress Classic Themes
May 10, 2010 at 3:59 pm
[...] New in WordPress 2.9: Post Thumbnail Images « Mark on WordPress – First, in the theme’s functions.php, declare that your theme supports this feature. This will enable the UI in the WP Admin. ‹Previous Post Bookmarks for May 12th from 15:39 to 15:39 [...]
Bookmarks for May 13th from 13:27 to 13:27 | Travis' Blog
May 13, 2010 at 10:26 am
Thanks!! This is great!!!
rodrigo
May 14, 2010 at 12:36 pm
Hi
i have installed a wordpress component for joomla but when i try this feature i am not geeting any post thumbnail box on editor page in admin side
i have tried by putting in /wp-content/themes/sk/functions.php
if ( function_exists( ‘add_theme_support’ ) ) {
add_theme_support( ‘post-thumbnails’ );
}
what will be reason? any one can help fast?
Tatva168
May 15, 2010 at 8:34 am
hello
i’m so happy that i found this site. that article was so great. thanks again i signed up to this website.
are you planning to post similar articles?
Gewinne
May 16, 2010 at 9:31 am
Thank you for this great article!
Mark
May 16, 2010 at 9:36 am
Thanks for the step-by-step tutorial. I haven’t altered my WordPress yet, but this feature is something i would really like to employ in my blog.
Peruecken
May 16, 2010 at 11:25 am
The array($with,$height) did not work, it returns a square thumbnail. Added set_psot_thumbnail and add_image_size in funtions.php.. didn’t crop correctly, some thumbs were 135×80, while i want 186×80..
I was forced to do it this way:
the_post_thumbnail( ‘joint-thumbnail’, array(‘class’ => ‘alignleft post_thumbnail’, ’style’ => ‘width: 186px; height: 80px;’));
The inline CSS was the only way, because CSS would not override the element style, IMG had a width and height attribute in html.
joeri
May 16, 2010 at 8:30 pm
[...] wir nicht genauer ins Detail gehen wollen, verweisen wir lieber auf die sehr ausführliche Anleitung von Mark Jaquith. Wir möchten euch ja zeigen, wie man die Bildgrössen manuell abwechseln kann. Dazu werden [...]
How-To: Post Thumbnail Format abwechseln - Beitrag - Schweizer WordPress Magazin
May 17, 2010 at 9:29 am
Hi, sorry if this has been asked before, but is there a way to not hard-code the thumbnail size values into the functions.php? What kind of code could be used for the thumbnail function to pull from the values in the WP media settings for thumbnails?
Laura
May 19, 2010 at 10:42 am
This is an invaluable blog post. I am going to work through this over the next couple of days and set this knowledge in concrete somewhere.
Thanks so much.
Lee
May 19, 2010 at 7:39 pm
[...] Mark on WordPress: Post Thumbnail Images – a good article on adding post thumbnail support to your theme [...]
Wordpress Post Thumbnails
May 19, 2010 at 10:07 pm
[...] I found this super awsome tutorial on how to add thumbnail image to your posts. Read more here. [...]
Adding images | DePescatore.com | Hursmakadematen?.se
May 20, 2010 at 7:33 am
Loving the thumbnail functionality. Anyone who needs to extract the thumbnail src URL during the loop (e.g. for CSS background images) can do so using:
preg_match('/(src)="([^"]*)"/i', get_the_post_thumbnail( get_the_ID(), 'single-post-thumbnail' ), $matches); echo $matches[2];or try here if it doesn’t show right:
http://paste.ly/1eq
Stephen Lang
May 20, 2010 at 10:41 am
Adapted Stephen’s code for use in a function, so that running multiple instances of it isn’t such a hassle…
Paste this in to your theme’s functions.php:
function thumbSrc( $t , $s ) { preg_match('/(src)="([^"]*)"/i', get_the_post_thumbnail($t , $s ), $matches); return $matches[2]; }and then call it like this:
thumbSrc(ID,’size’);
for instance when I was using it with the Gigpress plug-in:
$agenda_post_id = $showdata['related_id'];
thumbSrc($agenda_post_id, ‘thumbnail’)
this method also allows you to get the larger one.. good for when you want to link to it or whatever..
thumbSrc($agenda_post_id, ‘large’);
Jeffrey van der heide
June 1, 2010 at 9:15 am
Great feature, and excellent information here, thank you Mark! I have the same problem as MichaelC. Since enabling this, I get intermittent server 500 errors or blank pages when saving posts/pages. I can’t see a pattern to it. Any advice?
Sam Stevens
May 20, 2010 at 6:52 pm
Awesome stuff mark.. I had no clue about the new thumbnail feature in wordpress 2.9.2! You saved a lot of my time in converting images to thumbnails by coding it …
Thanks for sharing the knowledge..
Sumeet Chawla
May 22, 2010 at 5:14 pm
By the way, can you put more light on how can we modify the alternate text of the thumbnail at code level? By code level I mean not going to the backend and editing the alternate text of the original image
Sumeet Chawla
May 22, 2010 at 5:39 pm
[...] latest WordPress version(2.9) allows you to use built in featured image uploader. I’ve added this feature in all themes(Photopro, Complex, [...]
Reboot | Frozr.com
May 22, 2010 at 6:46 pm
[...] 或者:New in WordPress 2.9: Post Thumbnail Images [...]
[手册]如何使用WordPress 2.9内置文章缩略图功能(Post Thumbnail) - 阿Q的项目
May 25, 2010 at 9:21 pm
[...] insert the following code in any loop you want to display the thumbnail More detailed discussion here This entry was posted in hacks. Bookmark the permalink. Hello world! [...]
Post thumbnails | WP NDM Blog
May 26, 2010 at 1:12 am
Thanks for the information. Exactly what I was looking for. I really love the direction that WordPress is taking this. I’ve been duplicating these features using plugins every which way, but this is fantastic to have a way that is built right into the application.
I wish there were more ways to customize the custom fields. I use Magic Fields (and previously Flutter) and I really love how it adds the UI for the different types of custom fields. This image upload is another great step in that direction.
Bryan
May 26, 2010 at 10:22 pm
Thanks Mark,
Don’t Tell xentek but i wanted to play with a different theme then k2. So im trying Thematic and there was no thumbnail support.
Now there is ;c )
James Tryon
May 27, 2010 at 12:30 pm
[...] a new workshops section for raksasala.com website. It’s using the Events Calendar 3 plugin, post thumbnails, the More Fields plugin, and a custom [...]
Fuller Web Development - Wordpress Events Calendar for RakSa
May 28, 2010 at 1:53 pm
I want to display thumbnails gallery, if the visitor one of the thumbnails, it will bring to the post.
How to do this?
Dog For Sale
May 29, 2010 at 8:16 am
Hello Mark,
I tested your work and I see that You must not add the “add_theme_support()” for post and page in order to run good. I can provide extra code for example if needed..
Andrei
May 31, 2010 at 1:47 pm
Also i observer that when i delete a picture it doesn’t delete the thumbs from server. And when many pictures are added and deleted lot of thumbs remain on server…
Andrei
May 31, 2010 at 2:28 pm
http://66.147.242.160/~studipd1/ is my temporary site, the post-thumbnail doesn’t work for my site.
when i right click on the image on front page, it says “not found”.
please help….
june
June 1, 2010 at 3:36 am
Fantastic! Cleared up an issue I was having with my theme… thanks.
3Polars
June 1, 2010 at 9:28 am
I followed your tutorial, and I got the thumbs and I want a custom size like w=180 h=115 but for some photos I get a square thumb like w=115 h=115, if I change the settings and put w=115 h =180 I still get a square thumb with w=115 h=115, seems to overwrite the bigger setting and make a square thumb, tried regenerating the thumbs and nothing worked
Any help is appreciated
Banik
June 1, 2010 at 12:59 pm
[...] New in WordPress 2.9: Post Thumbnail Images « Mark on WordPress. Share and Enjoy: [...]
KafeKafe » New in WordPress 2.9: Post Thumbnail Images
June 2, 2010 at 11:50 am
In order to run good the thumb nail options i have this in my function.php or a plugin
add_theme_support('post-thumbnails');
set_post_thumbnail_size( 120, 80, true ); // 120 pixels wide by 80 pixels height, crop mode on
add_image_size('single-post-thumbnail',200,100,true);
add_action('delete_attachment','pa_delete_attachment');
function pa_delete_attachment($postid) {
global $wpdb;
$path = wp_upload_dir();
$rez = wp_get_attachment_metadata($postid);
foreach($rez['sizes'] as $size)
if(is_file($path['path']."/".$size['file']))
unlink($path['path']."/".$size['file']);
}
And in the theme file i have like this
if(has_post_thumbnail() :echo get_the_post_thumbnail(NULL,'post-thumbnail',array('class'=>'alignleft'));
endif;
I use the action on delete_attachment because i found out that wordpress doesn’t delete the custom thumb size like : single-post-thumbnail in my case..
Andrei
June 3, 2010 at 4:14 am
Thanks, you saved me a lot of time. Very simple and effective – just what I needed.
balkanboy
June 5, 2010 at 4:06 pm
Tnx! Worked like a charm, ive used it in a 3 column custom theme, specially built for artists. you can check it out here:
http://www.marinkevanzandwijk.nl
Will
June 7, 2010 at 6:32 pm
I’ve tried to implement this, but on the edit post page, when I click “Post Thumbnail”, the lightbox interface that pops up with the title “Add an image” is completely blank… Any ideas on whats wrong?
Amanda
June 8, 2010 at 7:11 am
Thanks for this article. It was very useful for a blog that I’m working on.
Evelyne
June 8, 2010 at 1:45 pm
Don’t know find anybody solution how to get thumbnail image url.
Thats what i done and it works fine.
Add to functions.php in theme folder:
function thumbSrc( $t , $s )
{
$thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id($t), $s);
return $thumbnail[0];
}
Then call it in template:
ID,’thubnail’); ?> or ID); ?>
I have set three sizes of image:
add_theme_support( ‘post-thumbnails’, array( ‘post’ ) ); // Add it for posts
set_post_thumbnail_size( 95, 9999 ); // 95 pixels wide by 9999 (no limit) pixels tall, box resize mode
add_image_size( ‘middle-thumbnail’, 165, 9999 ); // Permalink thumbnail size
add_image_size( ‘max-thumbnail’, 350, 9999 );
Set the same sizes in admin panel Options->Medifiles
Then I call them where i need it:
ID,’thumbnail’); ?>
ID,’medium’); ?>
ID,’large’); ?>
Same results for pair
ID,’max-thumbnail’); ?>
ID,’large’); ?>
ID,’middle-thumbnail’); ?>
ID,’medium’); ?>
Sorry for my English
Hope this will help somebody.
AntowaKartowa
June 9, 2010 at 6:11 am
O shit. Corrupted
AntowaKartowa
June 9, 2010 at 6:15 am
Love is a canvas furnished by nature and embroidered by imagination.
google
bebenajib
June 9, 2010 at 1:49 pm
[...] [...]
Top 10 Ways to Tweak Your WordPress Theme
June 10, 2010 at 11:13 am
[...] using some CSS. You can also add various thumbnail sizes, and cropping options. Check out this detailed tutorial about the Post Thumbnails feature for more [...]
Top 10 Ways to Tweak your Wordpress Theme | AlexVerse
June 10, 2010 at 11:44 am
[...] using some CSS. You can also add various thumbnail sizes, and cropping options. Check out this detailed tutorial about the Post Thumbnails feature for more [...]
Top 10 Ways to Tweak Your WordPress Theme | RetweetToday.com | News for Us, by Us!
June 10, 2010 at 5:09 pm
[...] using some CSS. You can also add various thumbnail sizes, and cropping options. Check out this detailed tutorial about the Post Thumbnails feature for more [...]
Binomial Revenue » Blog Archive » Top 10 Ways to Tweak Your WordPress Theme
June 11, 2010 at 12:58 am
[...] using some CSS. You can also add various thumbnail sizes, and cropping options. Check out this detailed tutorial about the Post Thumbnails feature for more [...]
Top 10 Ways to Tweak Your WordPress Theme | Xiaoqi He ( Harry He ) – Official Blog – 贺孝琦官方博客
June 11, 2010 at 1:05 am
[...] Next, you should specify the dimensions of your post thumbnails. You have two options here: box-resizing and hard-cropping. Box resizing shrinks an image proportionally (that is, without distorting it), until it fits inside the “box” you’ve specified with your width and height parameters. For example, a 100×50 image in a 50×50 box would be resized to 50×25. The benefit here is that the entire image shows. The downside is that the image produced isn’t always the same size. Sometimes it will be width-limited, and sometimes it will be height-limited. If you’d like to limit images to a certain width, but don’t care how tall they are, you can specify your width and then specify a height of 9999 or something ridiculously large that will never be hit. view source [...]
test
June 11, 2010 at 4:24 am
[...] using some CSS. You can also add various thumbnail sizes, and cropping options. Check out this detailed tutorial about the Post Thumbnails feature for more [...]
cdotg » Top 10 Ways to Tweak Your WordPress Theme via Mashable
June 11, 2010 at 10:56 am
[...] using some CSS. You can also add various thumbnail sizes, and cropping options. Check out this detailed tutorial about the Post Thumbnails feature for more [...]
Top 10 Ways to Tweak Your WordPress Theme
June 11, 2010 at 12:18 pm
A humankind begins icy his perceptiveness teeth the earliest without surcease he bites off more than he can chew.
boat cover
June 15, 2010 at 1:53 pm
To get just the src of the image instead of the full html output do the following. The function assumes that you are in the loop.
function my_custom_post_image($post_id){
if (has_post_thumbnail()){
$thumbnail_id = get_post_thumbnail_id($post_id);
$thumb = wp_get_attachment_image_src($thumbnail_id, array(793, 318));
return $thumb[0];
} else {
return II_IMAGES . '/story.jpg';
}
}
For more documentation see the Codex: http://codex.wordpress.org/Function_Reference/wp_get_attachment_image_src
Nick Hammond
June 15, 2010 at 6:21 pm
To get just the src of the image instead of the full html output do the following. The function assumes that you are in the loop.
function my_custom_post_image($post_id){
if (has_post_thumbnail()){
$thumbnail_id = get_post_thumbnail_id($post_id);
$thumb = wp_get_attachment_image_src($thumbnail_id, array(793, 318));
return $thumb[0];
} else {
return 'path/to/default/image/blah.jpg';
}
}
For more documentation see the Codex: http://codex.wordpress.org/Function_Reference/wp_get_attachment_image_src
Nick Hammond
June 15, 2010 at 6:22 pm
[...] New in WordPress 2.9: Post Thumbnail Images [...]
Rob and Kill » New in WordPress 2.9: Post Thumbnail Images
June 16, 2010 at 12:36 am
I wear an artificial StudioPress news wordpress theme using pictures with different hosting but do not work but I’ll try it this way, good luck thanks
netmild
June 17, 2010 at 7:29 am
Thank you for this! I’ve been fussing with WordPress for weeks not trying to get a decent related posts plugin with thumbnail functionality to work and after finding this it now works. Thank you!!!
Zellain
June 20, 2010 at 7:52 pm
[...] New in WordPress 2.9: Post Thumbnail Images [...]
zafer elektrik
June 21, 2010 at 12:35 pm
[...] for auto posting articles to social networks such as Facebook, however if you implement the ‘post thumbnail‘ feature in your WordPress theme, your ‘post thumbnail’ may not be displayed on [...]
IROKM.com » How to enhance Facebook posts with RSS Graffiti
June 22, 2010 at 3:01 am
How can I get the thumbnails to show up in the rss feed? Thanks!!
Christopher Gaston
June 22, 2010 at 10:07 am
What about getting this to work in the rss feeds?
Christopher Gaston
June 22, 2010 at 11:27 am
I’ve looked around quite a bit an there doesn’t seem to be any way to make the thumbnail into a link, even in WordPress 3. Will this function be added in the future?
Adrienne Adams
June 22, 2010 at 6:00 pm
[...] new SemiotiX also takes advantage of the built-in support for post thumbnails, making it very easy for editors to upload an image and use it as a thumbnail for display on the [...]
Now live: SemiotiX New Series, a WordPress-based e-journal — The Ideophone
June 23, 2010 at 4:37 am
[...] New in WordPress 2.9: Post Thumbnail Images [...]
Wordpress Yazı Resmi (Thumbnail) Özelliği
June 23, 2010 at 12:34 pm
Embroidery designs – creative embroideries by Download-Embroidery.com, free embroidery designs. New embroidery designs every week.
Monicahender
June 23, 2010 at 1:06 pm
I found this tutorial for calling the URL of the post_thumbnail so that it can be used for lightbox/shadowbox:
http://www.leewillis.co.uk/getting-url-post-thumbnails-wordpress/
It would be nice if this function is added to Core, as well as the ability to retrieve the image’s caption and/or title.
Adrienne Adams
June 23, 2010 at 1:35 pm
[...] most themes do not support the feature and though you can convert a theme to use it, the process is far from simple for someone easily intimidated by [...]
Featured Image: WordPress’ Best Underused Feature
June 24, 2010 at 4:57 pm
soooooooo
what happens if my theme does not have a ‘functions.php’ file…
Can I just make one with this code above? How do you make sure its read by the rest of the theme?
(I am in no way a web developer, just a designer trying to make things happen with my wordpressssssss)
Thanks for your help.
Evan
June 24, 2010 at 9:15 pm
Hi guys! great tutorial!
Oyun
June 25, 2010 at 4:50 am
[...] (via) Share/Bookmark var a2a_config = a2a_config || {}; a2a_config.linkname="如何在WordPress里使用Featured Image功能"; a2a_config.linkurl="http://docolours.com/wordpress/howto-output-featured-image-function-theme.html"; [...]
如何在WordPress里使用Featured Image功能 | DoColours
June 27, 2010 at 9:06 am
Love your post my friend…just started adding it to new themes I build for clients. Works like a charm and is a much better solution than using Custom Fields. Thanks for your time!
Jay
June 28, 2010 at 4:04 pm
work like a charm!!!,, thanks for the tutorial,
spartax
June 28, 2010 at 10:22 pm
[...] For more details check out this excellent post by Mark Jaquith. [...]
Create your first WordPress Custom Post Type | Carsonified
June 30, 2010 at 7:01 am
[...] explains it: http://markjaquith.wordpress.com/2009/12/23/new-in-wordpress-2-9-post-thumbnail-images/ What if you want to use a small 50×50 hard-cropped image for the home page, but want to use a 400 [...]
yolise on "post thumbnail resizing not working for me" : Rurykster.net
June 30, 2010 at 8:01 am
[...] Nesse site (em inglês) explica melhor o seu uso que me salvou. Até a possibilidade de ter mais de um formato pode ser usado. [...]
WP – Adicionando Thumbs aos posts | F.Norte
June 30, 2010 at 10:58 am
the_post_thumbnail() should allow specification of class for css purposes
Eddi Hughes
June 30, 2010 at 6:11 pm
I’m having trouble with thumbnails.
I can’t seem to control them…
where there is no add theme thumbnail function in my functions.php they are STILL displaying.
nick
July 1, 2010 at 1:25 pm
[...] On a less technical note, I have met three people relevant to plugin development: When I explained to Julia Seeliger that I was implementing her plugin idea, she was delighted. Max Winde, creator of the inspiring Spreeblick plugin, suggested including an easy option for re-embedding the relevant content, possibly using Javascript. Last but not least, Moritz Metz, a radio journalist and blogger at Breitband, intending to use the plugin when it is finished, told me about his use of alternate content and plugin directories and urged me to consider supporting not only inline content, but also post thumbnail images. [...]
GSoC CC Wordpress Plugin: Weekly Report #3 - Creative Commons
July 1, 2010 at 7:16 pm
[...] the coming week, I will look into post thumbnails, which require no inline markup for purely decorative pictures, like those used at Spreeblick and [...]
GSoC CC Wordpress Plugin: Weekly Report #5 - Creative Commons
July 1, 2010 at 7:18 pm
I’m trying to add a featured image to my post, but pressing “crop” does nothing. When I save the featured image, WP ignores my selection, auto-selecting a portion in the center of the image instead. Ideas?
stephen
July 1, 2010 at 7:31 pm
Thank you for this feature, it really simplified and saved lots of time to display thumbnails on my homepage!
Wordpress Themes
July 2, 2010 at 3:41 pm
[...] plugin is retired. Please use Post Thumbnails [...]
Retired | scribu
July 3, 2010 at 6:39 pm
[...] http://markjaquith.wordpress.com/2009/12/23/new-in-wordpress-2-9-post-thumbnail-images/ [...]
thumnail | Lighting TD
July 4, 2010 at 9:50 am
Thanks for the info Mark, I really appreciate it!
William
July 4, 2010 at 9:37 pm
[...] For more details check out this excellent post by Mark Jaquith. [...]
Create your first WordPress Custom Post Type « Perfect WP
July 4, 2010 at 9:37 pm
[...] WordPress 2.9, theme authors can easily enable Post Thumbnail selection UI and call those image using simple template tags. This is the most reliable, simple and [...]
Thumbnail Images On Wordpress Posts | Webmaster Resources
July 5, 2010 at 8:12 am
[...] takođe dodati mogućnost različitih veličina i opciju za sečenje slika. Pogledajte ovaj tutorijal o opciji Post Thumbnails za više [...]
10 načina da izmenite svoju WordPress temu | Adriatek
July 7, 2010 at 7:43 am
Hi Mark,
I used a tutorial by one of the support staff on itunes to create a magazine style home.
I am also going to use Remote Publishing on my site have have it all working to a point. I can create the posts automatically with the php i have wrote but i was wondering f you know if there is any way i can use XML-RPC publishing protocols to add a featured image/thumbnail to the post???
Kieron
July 7, 2010 at 6:24 pm
Hi Mark,
I used a tutorial by one of the support staff on itunes to create a magazine style home.
I am also going to use Remote Publishing on my site have have it all working to a point. I can create the posts automatically with the php i have wrote but i was wondering f you know if there is any way i can use XML-RPC publishing protocols to add a featured image/thumbnail to the post??? cvdscvdf
Kieron
July 8, 2010 at 3:30 pm
better than the codex entry for the_post_thumbnail
Seb
July 8, 2010 at 6:37 pm
[...] http://markjaquith.wordpress.com/2009/12/23/new-in-wordpress-2-9-post-thumbnail-images/ [...]
RVoodoo on "Thumbnail Not Working" : Rurykster.net
July 12, 2010 at 1:45 pm
Hi!
Thanks for the great tutorial. I have everything up and running with WP 2.9.2. but it does not work at all with WP 3.0.. The theme works otherwise jsut fine. ALso when I am trying to add the thumbnails according to the tutoria to new theme running on WP 3.0 I have no luck.. The new theme on the other hand works like charm on 2.9.2.
Any hints how to work this out? Thanks.
Kanttila
July 12, 2010 at 3:33 pm
[...] WordPress 2.9, theme authors can easily enable Post Thumbnail selection UI and call those image using simple template tags. This is the most reliable, simple and [...]
Thumbnail Images On WordPress Posts | zevWorks
July 12, 2010 at 8:00 pm
Hi!
nice tut, buti i have a question: there’s a way to change the name of the metabox, for example placing a “Thumbnail” instead of “featured image”?
thanks for replies.
Luigi Barbati
July 13, 2010 at 3:38 am
[...] thumbnail figures: WordPress post thumbnails can now be embedded as figures with annotated markup, just like inline content. Since many theme [...]
GSoC CC Wordpress Plugin: Weekly Report #6 / #7 - Creative Commons
July 13, 2010 at 5:56 pm
What kind of shit is this? I pasted the code and, yes, now I have thumbnails in my excerpts… but all other post’s images are also shown as thumbnails! If you release some code, be sure it fucking works! What a crap and waste of time.
redsocks
July 15, 2010 at 7:12 pm
[...] For more depth on featured images I recommend you read Mark Jaquith’s pro writeup New in WordPress 2.9: Post Thumbnail images. [...]
WordPress 3.0 Part 1—Pre 3.0 and Beyond — Laura Kalbag
July 16, 2010 at 5:55 pm
progress doesnt sleep, not it is WP 3.0 already
Guaranteed seo
July 17, 2010 at 5:56 pm
I get syntax error messages when I try to add this: has_post_thumbnail() returns true/false and indicates whether the current post has a manually-chosen Post Thumbnail (in the loop):
1
the_post_thumbnail() outputs the Post Thumbnail, if it exists (in the loop):
1
to my functions.php.
And I’m still unable to see my featured images in the blog homepage, even though I have the option to set the when I edit posts. Any ideas?
sbteaches
July 22, 2010 at 2:15 pm
yey! great posts… definitely the one i need
jhOy
July 27, 2010 at 3:24 am
yey! great post… definitely the one i need
jhOy
July 27, 2010 at 3:24 am
Grocery products in our discount stores. Sale shopping, all discounts every week. Best prices, many gifts.
MarkusMill
July 27, 2010 at 5:00 am
Thanks,
Its Very Helpful.
Gaurav Chauhan
July 27, 2010 at 1:22 pm
my theme uses featued image box in admin post panel , after adding the add_theme_support( ‘post-thumbnails’ );
to the function.php , no new box(thumbnail) appears in admin panel.
please help
Gaurav Chauhan
July 27, 2010 at 2:55 pm
Thank you for this! I’ve been fussing with WordPress for weeks not trying to get a decent related posts plugin with thumbnail functionality to work and after finding this it now works.
mymoen
July 29, 2010 at 1:28 am
Embroidery designs : instant downloads embroidery by Download-Embroidery.com, free embroidery designs. New embroidery designs every week.
Konicahender
July 30, 2010 at 7:39 pm
Code snippits here to make the image clickable and fade on mouseover:
first few lines go in the archive.php, index.php or home.php
then you need a bit in the style.css file, if you want a fadein on mouseover then the with and height have to be fixed.
code: http://adeptris.pastebin.ca/1812560
David
Digital Raindrops
February 26, 2010 at 7:04 pm
David,
DO you know how to make the thumbnail point to the fullsize image of itself?
I have the files setup to pull the image to the permalink on all pages, but on the singlepost, I would like the thumbnail to pull up the fullsize of the image.
The stuff I tried makes it put “img width=”" and so forth
Eric S
February 26, 2010 at 8:21 pm
No sorry, as the theme I have is a portfolio, all i need to do is link to the post.
For a Photography Portfolio the full image would just be all or part of the post.
For a Services Portfolio or category maybe for a WordPress template website, the image could be part of the post or not for a case study.
david
Digital Raindrops
February 27, 2010 at 3:29 am
Hello!
I need to do something like this:
if ( has_post_thumbnail() ) {
the_post_thumbnail();
} else {
$thumb = getFirstImagefromPostandResize ();
set_post_thumbnail($thumb);
the_post_thumbnail();
}
getFirstImagefromPostandResize it’s ok code already available based on plugin.
I need to know how to do for this kind of function in wordpress : set_post_thumbnail($thumb)
in order to store my automatically generated thumbnail
and reuse it transparently with the_post_thumbnail() without passing by manual GUI uploader (set thumbnail);
Do you know how to do it? which function i have to call in wordpress?
thank you very much for your answers.
veda
March 4, 2010 at 9:34 pm
THank you for your reply at least!
I need to jump back into the code to figure out how to strip out the file being renamed with the sizes I think?
Eric S.
March 22, 2010 at 4:14 pm