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)

24
votes
4answers
14k 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 ...
22
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 ...
11
votes
3answers
22k 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
3answers
6k 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
4answers
3k 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 ...
10
votes
9answers
7k 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
1answer
6k 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 ...
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 ...
10
votes
5answers
2k 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 ...
9
votes
3answers
22k 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, ...
9
votes
7answers
24k 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 ...
8
votes
7answers
4k 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 ...
8
votes
5answers
2k 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 ...
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
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 ...
7
votes
1answer
3k 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, ...
6
votes
4answers
9k 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 ...
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
1answer
1k 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
4k 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
483 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 ...
6
votes
6answers
2k 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 ...
6
votes
2answers
643 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 -> ...
5
votes
2answers
6k 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 ...
5
votes
1answer
2k 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 ...
5
votes
4answers
4k 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' ...
5
votes
2answers
4k 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
967 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
756 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 ...
5
votes
1answer
357 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
504 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
3answers
786 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
8k 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
6k 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
8k 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" ...
4
votes
2answers
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, ...
4
votes
3answers
6k 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
1answer
455 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 ...
4
votes
1answer
353 views

Re-order media links?

I'm trying to re-order the links in the media box when selecting an image. I want to move "Use as featured image" above the insert into post button. I also want to rename the "Use as featured image" ...
4
votes
2answers
2k views

Post thumbnail outside the loop

I'm trying to get the post thumbnail in the sidebar which is in essence outside the loop. For some reason it seems impossible!!! I have tried all kinds of ways. Here is the wirking code: (I have ...
4
votes
2answers
829 views

Cropped featured image replaces original image in gallery

Firstly, I have done my research as thoroughly as I possibly can. Searches have been made, but I have not found any advice or solution as to my exact issue. Ok, time to explain. Currently I am ...
4
votes
1answer
2k views

How to add a 2nd “featured image” to a post?

My theme has a slider widget that allows the end user to select a category and it assigns the posts in that category to the slider. If a post has a featured image, its used as the background of the ...
4
votes
1answer
519 views

Featured image with the same height thumbs returns wrong thumb

I have 2 sizes thumbs for featured images with the same height: 300 x 200 540 x 200 I've checked the uploads folder and both thumbs with different sizes appear correctly: file_name-300x200.jpg ...
4
votes
1answer
607 views

Make featured image required

Is it possible to force user to set featured image on some types of posts. For example I've got custom post type mm_photo and I want to show some error message or somehow block user from publishing or ...
4
votes
2answers
772 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 ???
4
votes
3answers
573 views

How might I retrieve a featured post image from an external WP site and display it as a link back?

I have two WP sites. I want to reach from one of them, into the other, and retrieve specific featured images for posts, and display them with a link to that post. I am using this line (with the ...
3
votes
3answers
758 views

Any easy way to automatically set the first inline image in a post as the thumbnail?

Is there a plugin for this? Has anyone done it before?
3
votes
2answers
3k views

Retrieve 1st image in post and set it as featured image, when post is saved/updated

I need to set a featured image for every post I publish. So, when a post is published/updated, the script would scan the post for the first image using a script like this: // Get URL of first ...
3
votes
1answer
5k views

Set post-thumbnail (with php)?

A site I have inherited uses custom fields to set a path for thumbnails. Ideally I'd like to switch this over to use the built in post-thumbnail. Is there a way to procedurally set the post-thumbnail? ...