Post Thumbnail is a theme feature introduced with Version 2.9. Thumbnail is an image that is chosen as the representative image for Posts, Pages or Custom Post Types.

learn more… | top users | synonyms (1)

28
votes
4answers
19k views

Filter to remove image dimension attributes?

I'm working on a site based on a fluid width css template which sets a max-width on images to the width of the column containing them, and I need to remove the inline width and height dimension ...
25
votes
8answers
5k views

User-friendly cropping of post thumbnails?

Is there a way to let my users define the crop area of a post thumbnail? The thumbnails always are existing post attachments, I would rather not create an extra attachment per thumbnail. The post ...
15
votes
4answers
37k views

How do I set a featured image (thumbnail) by image URL when using wp_insert_post()?

While looking through the function reference entry for wp_insert_post(), I noticed that there's no parameter in the array it requires which will allow me to set the 'Featured Image' for a post, ...
14
votes
4answers
7k views

How can I make add_image_size() crop from the top?

I have a series of posts, all with featured images, but I need to be able to customise the crop top right corner. In this instance, I need them to be cropped from top right, but it would be useful to ...
11
votes
3answers
28k views

How do I get image url only on the_post_thumbnail

I want to know how to get image url on the_post_thumbnail() Default the_post_thumbnail() <img width="800" height="533" src="http://domain.com/wp-content/uploads/2011/02/book06.jpg" ...
11
votes
1answer
7k views

Setting a post's featured image from an embedded YouTube video

If I create a post that has an embedded YouTube video in it (so all I do is paste the YouTube URL into the post and let Wordpress automatically embed it for me), is there a way to have the thumbnail ...
11
votes
4answers
4k views

add_image_size() for specific Post Types

set_post_thumbnail_size( 80, 80, true ); // true for all post types Suppose I have two post types in play on my blog: Post, Video and Product. I may want a 80x80 image size for my posts, but 100x100 ...
11
votes
6answers
4k views

Minimum Dimensions Requirement for Featured Image?

I am creating a baseball website with multiple Authors. From past experience, no matter how well you know someone personally, it doesn't mean they will follow or even read your instructions. That ...
10
votes
5answers
27k views

Can I set a default featured image for a category?

I'm setting up a site with a theme that takes advantage of the "featured image" feature of WordPress. Since my end users are not the most tech saavy in the world, I'd like to set things up so that the ...
10
votes
9answers
8k views

How to automatically add rounded corners to thumbnails?

I want to created automatically rounded corner thumbnails for a particular project I'm working on, using something like this: ...
10
votes
2answers
3k views

How to retrieve image from URL and set as featured image/post thumbnail

Given a Vimeo ID, I can retrieve a thumbnail from the video via Vimeo Simple API. Rather than call the API every time my page loads I want to set the image as the post thumbnail using the save_post ...
9
votes
7answers
6k views

Get post thumbnail size

I know how to set the size of an image type: set_post_thumbnail_size( 150, 150 ) ..or using the media settings, but how do I get the image with and image height that have been set for an image ...
9
votes
5answers
5k views

How to disable WordPress from creating thumbnails?

I've been looking around the net for a long time on how to disable WordPress from creating multiple thumbnails. I've seen in most tutorials to set all the images to 0 in the media section. I have ...
9
votes
2answers
8k views

How do I regenerate thumbnails?

I just got a new theme and am trying to regenerate thumbnails. I'm having trouble though. I tried using the AJAX Thumbnail Rebuilder but for 5 hours it just said reading attachments. Then I tried the ...
9
votes
1answer
1k views

How to disable generation of default image sizes for some custom post types?

I used custom post type, where 'thumbnail', 'medium' and 'large' sized not required. I need to disable this sizes and create function or plugin, where i can set, which image size is required for each ...
9
votes
1answer
5k views

How to Dynamically Resize WordPress Image On-The-Fly (custom field/theme option)

So - at a client's request, I am in need of being able to resize an image not the standard WordPress way... but from an image pulled-in from a theme option. I can't simply use the custom_header area, ...
8
votes
2answers
13k views

How do you remove hard coded thumbnail image dimensions?

How can I remove the width and height attributes from the post_thumbnail when inserting with <?php the_post_thumbnail(); ?>? <img width="800" height="533" ...
8
votes
1answer
197 views

How to change image type for specific size?

I am optimizing a site with large (dozens) quantity of images on page in a grid. For retina support the images are also need to be 2x sized. The low hanging fruit was to make sure the thumbnail sizes ...
8
votes
3answers
2k views

What's the best way to use the Featured Image for responsive web design?

I have a brilliant idea and since WordPress already takes care of some of the work, I just need to find a good method to make this work. I am working on a project that needs to be responsive to all ...
8
votes
6answers
3k views

Display thumbnail only if requested size exists

When I use the functions that get and output the post thumbnail, they will display the requested thumbnail in the size you specify, but if this size doesn't exist they will display the thumbnail in ...
7
votes
4answers
14k views

Stop wordpress from hardcoding img width and height attributes

I'm wondering if there's a simple way top stop WordPress automatically hardcoding featured image height and width attributes, other than using regex... As I'm using a flexible grid for my project ...
7
votes
1answer
987 views

How to add multiple image sizes of the same size with add_image_size

I'm using a grayscale filter on all uploaded images in my WordPress installation. However I want both the gray scaled image and the colored image in my website (colored on hover). The way I tried to ...
7
votes
5answers
420 views

Generate Thumbnails only for Featured Images

I would like to know if there is a simple way (custom code or plugin) to create thumbnail sizes only for images that I intend to use as featured images (index.php, archive.php, etc.) , but not for the ...
7
votes
2answers
997 views

Set custom name for generated thumbnails

Is there any filter available to set the naming convention of those auto generated thumbnails? Something like this: thumbnail_150x150.jpg -> thumbnail-s.jpg thumbnail_300x300.jpg -> ...
6
votes
1answer
3k views

Programmatically get images by URL and save in uploads folder

I am involved in a large migration from another CMS to WordPress. We have a copy of the database and have worked out how to extract the content and programmatically create WordPress posts from it ...
6
votes
3answers
8k views

Get first image in a post

I am using this code directly from the codex. function echo_first_image ($postID) { $args = array( 'numberposts' => 1, 'order'=> 'ASC', 'post_mime_type' ...
6
votes
3answers
2k views

Delete original image - keep thumbnail?

I'm using a lot of thumbnails but never the original file. To save space, I'd like to prevent the original from being saved on disk but only keep a thumbnail of 100px. How can I do this? Thanks, ...
6
votes
4answers
7k views

Auto-retrieve YouTube Image for Thumbnail?

I have a custom post type that accepts a YouTube embed HTML snippet, title, and a featured image. Currently, I'm going and finding an image for the featured image, but ideally I would be able to ...
6
votes
4answers
48k views

How to Fix HTTP Error When Uploading Images?

I am using WordPress 3.4.1 on Ubuntu 12.04 using Apache and PHP 5.3.X When I login to the dashboard and add a new post. Then try uploading an image to set as a featured image, I get a red box with a ...
6
votes
1answer
5k views

How to get featured image's width and use elsewhere in template?

I'm wondering if it's possible in the single.php template to use the width of the post's featured image elsewhere in the page. What I'm trying to do is add a div element on the page with the same ...
6
votes
1answer
2k views

What plugin can I use to create a list / slideshow of featured images?

I'm looking for a plugin that will allow the user to upload files, maybe 4-10 that can be used on the homepage as part of a slideshow. I can code the slideshow part myself, if necessary, but the thing ...
6
votes
1answer
662 views

is it possible to replace the use of gd_lib with imagick or ImageMagick?

i'm looking around for a solution since weeks and can't make anything work yet. the problem is that my server is running debian/lenny and it's not supporting the bundled gd_lib which i need for ...
5
votes
2answers
6k views

set_post_thumbnail_size vs add_image_size

What is the difference between set_post_thumbnail_size and add_image_size? Is set_post_thumbnail_size for all images, and add_image_size for sizing images individually? Thanks.
5
votes
2answers
5k views

Using add_theme_support inside a plugin

I've created a custom post type as a plugin and released it into the repository. One of the core features involves using a featured image. I've added thumbnail to $supports in register_post_type(), so ...
5
votes
2answers
1k views

New image size version only for the Featured Image file

I'm worried about too many files created when adding a new image size. All uploaded files will generate the new size, I need a specific image size only for the file set as Fetured image, is there ...
5
votes
1answer
133 views

Prevent WordPress from cropping GIF files

Is there any way to prevent WordPress from cropping files based on their file extension. Actually, I want to disable cropping for GIF files because after cropping GIF image... GiF image does not ...
5
votes
1answer
496 views

What's the difference between post thumbnails and featured images (if any)?

On the Codex on Post Thumbnails, I see: Post Thumbnails is a theme feature introduced with Version 2.9. It was quickly changed to Featured Images with Version 3.0. Post Thumbnail, now Featured ...
5
votes
2answers
793 views

Require featured image

I would like to require a featured image on a site I am developing. I tried the code here: Make featured image required and nothing happened - the JS showed up in the site header, but I could still ...
5
votes
2answers
1k views

Prevent publishing the post before setting a featured image?

As the title says , I want a plugin/function to prevent/inform the user when he tries to publish the post without setting the featured image. ANY HELP ???
5
votes
3answers
1k views

Set Featured Image for Archive templates

I'm want to set a featured image for the archive templates of my theme. To my knowledge, there is not a way to do so in the WordPress Admin (like Pages and Posts). I was thinking about writing a ...
4
votes
4answers
2k views

What is your take: TimThumb vs. WordPress Thumbnails? The great debate [closed]

When it comes to excerpts, do you believe TimThumb or WordPress thumbnails is the way to go? And why? Answers will not be graded (but may be criticized).
4
votes
1answer
12k views

Upload post thumbnail from the front end

We would like users to be able to upload the post thumbnail when editing posts. How would this be done. I would imagine it would make use of the ajax functions of wordpress. Any ideas, Marvellous
4
votes
2answers
9k views

Display Post Thumbnail Without Being Featured Image

I'm hoping that I can explain what I'm going for here. On my current project's main page, I'm displaying each post's Featured Image Thumb, along with an excerpt of the post's content. In each of the ...
4
votes
2answers
2k views

Featured Image of Video from oembed

For Wordpress, I want to auto generate thumb of the video embedded on a page using oembed? And then save it as a featured image of the post. Any idea how to do this?
4
votes
8answers
9k views

the_post_thumbnail hard cropping not working no matter what

No matter what I do - I can't get the hard cropping mode in the_post_thumbnail to work. Here's what I have: add_image_size( 'Blog', 300, 300, true ); the_post_thumbnail('Blog'); I've also tried: ...
4
votes
2answers
439 views

Differentiate Featured Image from Post Images upon Upload

I want to differentiate the featured image from post images. The plan is to give the Featured Image multiple sizes, but the images inside / connected to the post only needs the default sizes. I ...
4
votes
1answer
10k views

How can I add the featured image functionality to a custom taxonomy?

I would like to be able to use the 'featured image' functionality, found on post types, for a custom taxonomy. I have a taxonomy called 'collections' and I would like each collection to have a ...
4
votes
3answers
7k views

Multiple featured image thumbnails for post types (Multiple Post Thumbnails plugin)

I found a plugin called Multiple Post Thumbnails and followed the directions in getting it set up. Everything shows up correctly in the admin dashboard (i.e. shows two sections to upload two separate ...
4
votes
3answers
5k views

Getting Thumbnail Path rather than Image Tag

I see many methods of showing thumbnails in WordPress, but I'm not immediately sure how I could get only the path to a post's thumbnail rather than the html-ready code generated by functions like ...
4
votes
1answer
692 views

Move from old custom field to new post_thumbnails

I've just taken over a busy WordPress site that's got ~800 posts so far. The site's been around long enough that it was started up before post_thumbnails was available. They worked around that ...