Mark on WordPress

WordPress puts food on my table.

New in WordPress 2.9: Post Thumbnail Images

with 420 comments

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!

Written by Mark Jaquith

December 23, 2009 at 3:19 am

420 Responses

Subscribe to comments with RSS.

  1. Thanks for all the details, this is exactly what I need for my theme.

    Fernanda Gomez

    December 23, 2009 at 5:14 am

  2. [...] 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. [...]

  3. Awesome guide, this will be handy for my theme.

    Andy

    December 23, 2009 at 8:37 am

  4. brilliant. see you at wordcamp atlanta!

    John (Human3rror)

    December 23, 2009 at 10:15 am

  5. 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!

  6. 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

  7. nicce! thanks for the post… i’ve been looking for this

    Revenue Robot

    December 23, 2009 at 2:39 pm

  8. Finally! 2.9 seems to really have its act together.

    Matthew Praetzel

    December 23, 2009 at 4:34 pm

  9. 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

  10. 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

  11. Cracks

    December 23, 2009 at 9:17 pm

  12. [...] 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. [...]

  13. Thanks for post. It’s good idea :)

    Süleyman Sönmez

    December 24, 2009 at 1:46 pm

  14. 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

  15. 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

  16. 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

  17. 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

  18. 7A33B4628B2A788BC43DC896EA5

    BobyMlMan

    December 27, 2009 at 2:58 am

  19. [...] New in WordPress 2.9: Post Thumbnail Images at Mark on WordPress (tagged: wordpress tutorial todo ) [...]

  20. 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

  21. [...] New in WordPress 2.9: Post Thumbnail Images « Mark on WordPress. Partagez cette page : [...]

  22. [...] alcune accattivanti novità, tra cui il Post Thumbnail Images e inoltre -Funzionalità di annulla/”cestino” globale, che significa che se si cancella per [...]

  23. 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

  24. [...] 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 [...]

  25. 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

  26. 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

  27. [...] Mark Jaquith, célèbre développeur de WordPress nous en dit plus sur la manière d’utiliser cette nouvelle fonctionnalité. [...]

  28. Great post. I appreciate the help.

    Hoods

    December 29, 2009 at 6:24 am

  29. [...] 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

  30. great post! thanks

    dowlie

    December 29, 2009 at 10:31 am

  31. 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

  32. [...] Mark Jaquith, célèbre développeur de WordPress nous en dit plus sur la manière d’utiliser cette nouvelle fonctionnalité. [...]

  33. 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

  34. 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

  35. 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

  36. 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

  37. 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

  38. 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

  39. [...] 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. [...]

  40. 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

  41. [...] Mark on WordPress | New in WordPress 2.9: Post Thumbnail Images [...]

  42. 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

  43. 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

  44. 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

  45. 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

  46. 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

  47. [...] New in WordPress 2.9: Post Thumbnail Images [...]

  48. [...] 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. [...]

  49. 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

  50. 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

  51. Is there a return such as post_thumbnail for this?

    Andrew Harbert

    January 6, 2010 at 6:27 pm

  52. 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

  53. Is there an easy way to add rollovers to the thumbs?

    Kenny

    January 7, 2010 at 9:49 pm

  54. I’m so happy that WordPress finally added this functionality. Thanks for the break down!

    MediaMisfit

    January 8, 2010 at 2:19 am

  55. 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

  56. 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

  57. [...] 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. [...]

  58. [...] 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 [...]

  59. This is just fantastic! I’ve been waiting for this for a long time!

    Pepijn

    January 11, 2010 at 10:16 am

  60. [...] avec les thumbnails de la 2.9, on peut tout faire [...]

  61. [...] 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) [...]

  62. 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

  63. [...] Mark Jaquith: New in WordPress 2.9: Post Thumbnail Images [...]

  64. You rock man !

    Luglio7

    January 12, 2010 at 5:01 pm

  65. 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

  66. [...] 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 [...]

  67. [...] New in WordPress 2.9: Post Thumbnail Images « Mark on WordPress  [...]

  68. [...] New in WordPress 2.9: Post Thumbnail Images: Mark Jaquith looks at the new Post Thumbnail image options in WrodPress 2.9. [...]

  69. 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

  70. [...] New in WordPress 2.9: Post Thumbnail Images « Mark on WordPress – [...]

  71. 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

  72. 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

  73. [...] New in WordPress 2.9: Post Thumbnail Images [...]

  74. 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

  75. @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

  76. I found out that the alt attribute is actually the legend.

    Fairweb

    January 16, 2010 at 2:45 am

  77. 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

  78. 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

  79. 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

  80. [...] New in WordPress 2.9: Post Thumbnail Images [...]

  81. [...] New in WordPress 2.9: Post Thumbnail Images « Mark on WordPress (tags: howto development tutorials wordpress 2.9) [...]

  82. [...] Mark Jaquith’s Article on Post Thumbnails WordPress Codex [...]

  83. 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

  84. 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

  85. 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 :D 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 :D

      Babel

      January 20, 2010 at 3:56 am

  86. 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

  87. Comprehensive tutorial. Helped me out a lot today.
    Thanks.

    sidouglas

    January 20, 2010 at 8:41 pm

  88. 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

  89. [...] You may read more about activating the thumbnail functionality for your theme for example here. [...]

  90. 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

  91. 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

  92. 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

  93. This forum is alive? If yes, please remove this topic and my account.

    thineeeffer

    January 22, 2010 at 7:34 pm

  94. My test this forum number 2. trfekiol

    eagestype

    January 23, 2010 at 6:24 pm

  95. Would also love to have get_the_post_thumbnail…

    Frank Prendergast

    January 24, 2010 at 9:45 am

  96. 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

  97. 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

  98. [...] 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

  99. [...] Post Thumbnail Images on WordPress 2.9 – [...]

  100. [...] Mark Jaquith’s Article on Post Thumbnails WordPress Codex [...]

  101. [...] basics go like this. Check out Matt’s post and also visit Mark Jaquith’s and Kremalicious‘ posts on the subject for more [...]

  102. 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

  103. 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

  104. 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

  105. [...] 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, [...]

  106. [...] 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 [...]

  107. [...] plugin automatically assigns thumbnails to posts using the Post Thumbnail Interface introduced in WordPress [...]

    Post Thumbnail Plugin

    February 2, 2010 at 12:23 am

  108. Great, exactly what I was looking for!

    Shahar

    February 2, 2010 at 6:01 am

  109. 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

  110. doesn’t work on 2.9.1

    anon

    February 3, 2010 at 11:01 am

  111. 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

  112. 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

      <a href=""> "alignleft post_thumbnail")); } ?>
      

      Eric S

      February 3, 2010 at 9:15 pm

    • WELL CRAP! Sorry,

      Eric S

      February 3, 2010 at 9:15 pm

  113. [...] Mark Jaquith’s Article on Post Thumbnails WordPress Codex [...]

  114. 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

  115. 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

  116. 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

  117. 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

  118. 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

  119. 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

  120. 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

  121. 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

  122. 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

  123. 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

  124. [...] New in WordPress 2.9: Post Thumbnail Images [...]

    bbunker » T2010020501

    February 5, 2010 at 5:42 am

  125. <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

  126. information is very helpful me:) thank you for his info

    blogtutorial

    February 5, 2010 at 9:11 pm

  127. [...] Mark Jaquith’s Article on Post Thumbnails WordPress Codex [...]

  128. 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

  129. [...] 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 [...]

  130. [...] 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 [...]

  131. 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

  132. Thanks so much. This tutorial goes into such great detail!

    Vira

    February 15, 2010 at 2:24 am

  133. [...] 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 [...]

  134. Thank you for this post! (and thank Ed for linking to it JUST YESTERDAY!)

    ancawonka

    February 15, 2010 at 9:34 pm

  135. [...] method is depreciated in favor of the wordpress 2.9 thumbnail functionality.   Here is a good tutorial how to implement [...]

  136. 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

  137. [...] 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

  138. 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

  139. [...] All posts using the new “post thumbnail” feature in 2.9, [...]

  140. 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

  141. [...] New in WordPress 2.9: Post Thumbnail Images « Mark on WordPress [...]

  142. [...] 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 [...]

  143. [...] 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 [...]

  144. [...] 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 [...]

  145. [...] post é uma adaptação traduzida do post original de Mark Jaquith, que me ajudou a implementar esta nova funcionalidade num projecto recentemente.) Posted in [...]

  146. 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

  147. where are the functions for this located in core? Is there a filter for it?

    Mark Parolisi

    February 23, 2010 at 5:54 pm

  148. [...] restored (THX to Simone Fumagalli) – Resize automatic after the upload (THX to Simone Fumagalli) – Post Thumbnail [...]

  149. 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

  150. 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

  151. [...] 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

  152. [...] 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

  153. thanks Guy

    Toni

    February 27, 2010 at 5:25 pm

  154. There are better solutions like this:
    http://www.sebastianbarria.com/thumbgen/

    peivem

    February 28, 2010 at 11:36 pm

  155. Nice and easy to follow tutorial, thanks!

    Semut Design

    March 2, 2010 at 12:57 pm

  156. 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

  157. [...] out Mark Jaquith’s article for more detail on the usage of the thumbnail function. Damien Oh is the owner and [...]

  158. [...] New in WordPress 2.9: Post Thumbnail Images « Mark on WordPress – Wie man ab WP 2.9 Thumbnails für Posts nutzen kann [...]

  159. “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

  160. 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

  161. 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

  162. great post! thanks for info

    Brian Smith

    March 5, 2010 at 12:03 am

  163. [...] New in WordPress 2.9: Post Thumbnail Images ~ Mark Jaquith : I favor doing it this [...]

  164. [...] Vía | Mark Jaquith [...]

  165. 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

  166. [...] New in WordPress 2.9: Post Thumbnail Images – Mark Jaquith [...]

  167. [...] New in WordPress 2.9: Post Thumbnail Images – Mark Jaquith [...]

  168. [...] Also checkout another post onWP2.9 post-thumbnails. [...]

  169. great article, thanks for sharing.

    clark

    March 10, 2010 at 7:24 pm

  170. 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

  171. [...] 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 [...]

  172. 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

  173. [...] 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…; [...]

  174. 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

  175. im like it so much

    smartwordpress

    March 13, 2010 at 7:57 pm

  176. 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

  177. 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

  178. 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

  179. 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

  180. [...] 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 [...]

  181. 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

  182. [...] with 225 comments [...]

  183. [...] 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 [...]

  184. 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

  185. [...] WordPress v2.9 Post Thumbnail Images – easily enable thumbnail selection ui [...]

  186. 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

  187. 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

  188. 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

  189. 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

  190. 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

  191. thanks dear for help

    Muhammad Azhar

    March 23, 2010 at 3:22 pm

  192. 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

  193. 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

  194. 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

  195. 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

  196. [...] (note for additional options see here) [...]

  197. [...] Quellen: Onextrapixel, Mark on WordPress [...]

  198. 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

  199. [...] 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 [...]

  200. Hey very nice blog!! Man .. I will bookmark your blog and take the feeds also…

    Russia

    March 30, 2010 at 1:00 pm

  201. 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

  202. 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

  203. 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

  204. 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

  205. 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

  206. thanks Mark, It’s so useful -dario

    dario brozzi

    April 2, 2010 at 3:20 pm

  207. 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

  208. 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

  209. Therefore , how will youcelebrate this particular Easter Holiday?

    daviduxresll

    April 4, 2010 at 11:30 am

  210. [...] 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: [...]

  211. 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

  212. [...] additional thumbnail formatting and detailed parameters I love the guides by Mark on WordPress and WPEngineer.com very [...]

  213. 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

  214. 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

  215. 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

  216. [...] 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 [...]

  217. 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

  218. [...] 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 [...]

  219. This was really helpful for my blog, thanks!

    Mirco

    April 15, 2010 at 2:08 pm

  220. Compelling! On the phone a scintilla tough to understand, but advantage it!

    Myspace

    April 15, 2010 at 3:40 pm

  221. Interesting observation. Only infrequently is it truthful it is.

    Myspace

    April 15, 2010 at 3:54 pm

  222. Not perfectly caught some moments, but generally entertaining

    Myspace

    April 15, 2010 at 3:56 pm

  223. 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

  224. 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

  225. 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

  226. [...] 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

  227. [...] 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

  228. [...] 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 [...]

  229. [...] 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 [...]

  230. 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

  231. [...] 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 [...]

  232. “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

  233. [...] Source: For more details and options on Enabling Post Thumbnail Images, check here. [...]

  234. 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

  235. 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

  236. 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

  237. Great post

    Thanks alot

    Dat Tai

    April 22, 2010 at 5:43 pm

  238. 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

  239. 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

  240. 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

  241. 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

  242. Hey,

    Thnx for this great article it is really usefull!

    Murfix

    Matthisk

    April 25, 2010 at 10:27 am

  243. [...] tags. More information about how use post thumbnails and adjust their default sizes can be found at Mark Jaquith’s tutorial on the [...]

  244. [...] 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

  245. Thank you! =)

    JP

    April 27, 2010 at 1:44 pm

  246. 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

  247. 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

  248. excellent

    Thanks alot ,Pro

    Dat Tai

    May 2, 2010 at 5:33 pm

  249. [...]   这样就OK啦,不算太难吧,稍微发散一下思维就不难想到,缩略图的作用还不止于此,N久N久以前我介绍的用自定义域给每篇文章添加的缩略图也可以淘汰了,Wordpress 2.9 的 post thumbnails 缩略图功能完全可以替代自定义域添加的图片,而且方便简单,自定义程度更高,在和尘埃大哥合作的新主题中也有用到这招,帅呆了。有兴趣的想扩展一下的朋友可以继续参考这篇文章。 [...]

  250. [...] 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 [...]

  251. [...]   这样就OK啦,不算太难吧,稍微发散一下思维就不难想到,缩略图的作用还不止于此,N久N久以前我介绍的用自定义域给每篇文章添加的缩略图也可以淘汰了,Wordpress 2.9 的 post thumbnails 缩略图功能完全可以替代自定义域添加的图片,而且方便简单,自定义程度更高,在和尘埃大哥合作的新主题中也有用到这招,帅呆了。有兴趣的想扩展一下的朋友可以继续参考这篇文章。 [...]

  252. 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

  253. Spasibochki for writing! Used to write home.

    NimDouff

    May 7, 2010 at 9:08 pm

  254. Thanks for the tips bro.

    Amal Roy

    May 8, 2010 at 11:47 pm

  255. [...] the addition of post thumbnails in WordPress 2.9, developing news and magazine style sites is so much easier. Prior to post [...]

  256. [...] 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 [...]

  257. Thanks!! This is great!!! :)

    rodrigo

    May 14, 2010 at 12:36 pm

  258. 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

  259. 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

  260. Thank you for this great article!

    Mark

    May 16, 2010 at 9:36 am

  261. 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

  262. 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

  263. [...] 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 [...]

  264. 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

  265. 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

  266. [...] Mark on WordPress: Post Thumbnail Images – a good article on adding post thumbnail support to your theme [...]

  267. [...] I found this super awsome tutorial on how to add thumbnail image to your posts. Read more here. [...]

  268. 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

  269. 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

  270. 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 … :D 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

  271. [...] 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

  272. [...] 或者:New in WordPress 2.9: Post Thumbnail Images [...]

  273. [...] 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! [...]

  274. 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

  275. 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

  276. [...] 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 [...]

  277. 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

  278. 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

  279. 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

  280. 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

  281. Fantastic! Cleared up an issue I was having with my theme… thanks.

    3Polars

    June 1, 2010 at 9:28 am

  282. 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

  283. [...] New in WordPress 2.9: Post Thumbnail Images « Mark on WordPress. Share and Enjoy: [...]

  284. 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

  285. Thanks, you saved me a lot of time. Very simple and effective – just what I needed.

    balkanboy

    June 5, 2010 at 4:06 pm

  286. 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

  287. 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

  288. Thanks for this article. It was very useful for a blog that I’m working on.

    Evelyne

    June 8, 2010 at 1:45 pm

  289. 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

  290. Love is a canvas furnished by nature and embroidered by imagination.

    google

    bebenajib

    June 9, 2010 at 1:49 pm

  291. [...] 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 [...]

  292. [...] 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 [...]

  293. [...] 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 [...]

  294. [...] 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 [...]

  295. [...] 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

  296. [...] 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 [...]

  297. [...] 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 [...]

  298. 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

  299. 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

  300. 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

  301. [...] New in WordPress 2.9: Post Thumbnail Images [...]

  302. 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

  303. 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

  304. [...] New in WordPress 2.9: Post Thumbnail Images [...]

    zafer elektrik

    June 21, 2010 at 12:35 pm

  305. [...] 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 [...]

  306. How can I get the thumbnails to show up in the rss feed? Thanks!!

    Christopher Gaston

    June 22, 2010 at 10:07 am

  307. What about getting this to work in the rss feeds?

    Christopher Gaston

    June 22, 2010 at 11:27 am

  308. 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

  309. [...] 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 [...]

  310. [...] New in WordPress 2.9: Post Thumbnail Images [...]

  311. Embroidery designs – creative embroideries by Download-Embroidery.com, free embroidery designs. New embroidery designs every week.

    Monicahender

    June 23, 2010 at 1:06 pm

  312. 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

  313. [...] 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 [...]

  314. 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

  315. Hi guys! great tutorial!

    Oyun

    June 25, 2010 at 4:50 am

  316. [...] (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"; [...]

  317. 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

  318. work like a charm!!!,, thanks for the tutorial,

    spartax

    June 28, 2010 at 10:22 pm

  319. [...] For more details check out this excellent post by Mark Jaquith. [...]

  320. [...] 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 [...]

  321. [...] 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. [...]

  322. the_post_thumbnail() should allow specification of class for css purposes

    Eddi Hughes

    June 30, 2010 at 6:11 pm

  323. 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

  324. [...] 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. [...]

  325. [...] the coming week, I will look into post thumbnails, which require no inline markup for purely decorative pictures, like those used at Spreeblick and [...]

  326. 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

  327. 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

  328. [...] plugin is retired. Please use Post Thumbnails [...]

    Retired | scribu

    July 3, 2010 at 6:39 pm

  329. Thanks for the info Mark, I really appreciate it!

    William

    July 4, 2010 at 9:37 pm

  330. [...] For more details check out this excellent post by Mark Jaquith. [...]

  331. [...] 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 [...]

  332. [...] 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 [...]

  333. 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

  334. 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

  335. better than the codex entry for the_post_thumbnail

    Seb

    July 8, 2010 at 6:37 pm

  336. 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

  337. [...] 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 [...]

  338. 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

  339. [...] thumbnail figures: WordPress post thumbnails can now be embedded as figures with annotated markup, just like inline content. Since many theme [...]

  340. 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

  341. [...] For more depth on featured images I recommend you read Mark Jaquith’s pro writeup New in WordPress 2.9: Post Thumbnail images. [...]

  342. progress doesnt sleep, not it is WP 3.0 already

    Guaranteed seo

    July 17, 2010 at 5:56 pm

  343. 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

  344. yey! great posts… definitely the one i need :D

    jhOy

    July 27, 2010 at 3:24 am

  345. yey! great post… definitely the one i need :D

    jhOy

    July 27, 2010 at 3:24 am

  346. Grocery products in our discount stores. Sale shopping, all discounts every week. Best prices, many gifts.

    MarkusMill

    July 27, 2010 at 5:00 am

  347. Thanks,
    Its Very Helpful.

    Gaurav Chauhan

    July 27, 2010 at 1:22 pm

  348. 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

  349. 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

  350. 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

  351. 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

  352. 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

  353. 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

  354. 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

  355. 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


Leave a Reply