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)

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 ...
3
votes
2answers
4k 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 ...
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 ...
24
votes
4answers
15k 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 ...
6
votes
2answers
661 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 -> ...
2
votes
4answers
21k 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 ...
9
votes
3answers
23k 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, ...
3
votes
2answers
1k 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?
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 ...
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
9
votes
5answers
3k 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 ...
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 ...
5
votes
4answers
5k 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' ...
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).
3
votes
2answers
3k views

Set Featured Image Front Frontend Form

I have been struggling for days to figure this one out. I have successfully implemented a form to submit posts from the front end of my site. ButI can't figure out how to make the image uploads work. ...
1
vote
1answer
2k views

oEmbed, thumbnails and wordpress

Wordpress has wp_oembed_get, which I use to get rich media content with embed.ly. I've previously used oEmbed api calls such as this. As you can see it provides thumbnail_url, which I like to use ...
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? ...
3
votes
1answer
2k views

media_sideload_image generates blank?

I'm creating a custom post form that is supposed to take an external image and uploads it to the media library and attach it to that post. This should be possible by using media_sideload_image, but ...
4
votes
1answer
620 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 ...
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 ...
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 ...
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 ...
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
974 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 ...
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
787 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 ???
3
votes
2answers
409 views

Add Image Dimensions to Media Library Tab on Media Upoader

I would like to add the dimensions of each image to the media library tab in the media uploader. I have a multi-author website, where I require users to add a featured image with minimum dimensions. ...
3
votes
2answers
309 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 ...
3
votes
3answers
766 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?
2
votes
3answers
2k views

How to grab first image attached to post and display in RSS feed?

I've seen the tutorials on how to grab the first image and display it in a post, and those on grabbing the post_thumbnail and using that in the RSS feed, but does anybody know how to grab the first ...
1
vote
2answers
3k views

wordpress custom walker for thumbnails with custom menu

I'm still very novice at PHP so any help is greatly appreciated. Typically I have found the codex to be very helpful but it appears custom walkers may be outside its scope. I'd like to have ...
0
votes
2answers
3k views

Add class name to post thumbnail

I'm using post thumbnails to link to a page. Is it possible to add a class name to the post thumbnail image. <li><a href="<?php the_permalink(); ?>" ><?php the_post_thumbnail(); ...
0
votes
1answer
734 views

VT-resize image and display it [duplicate]

Possible Duplicate: Retrieve 1st image in post and set it as featured image, when post is saved/updated I am trying to make this works and instead of giving me the url of the image, it is ...
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 ...
1
vote
1answer
2k views

Can I refresh the thumbnails programmatically?

I would like to be able to refresh the thumbnail cache programmatically, not sure where to hook it, but at present any design changes mean re-uploading loads of images!
0
votes
1answer
19 views

Resize Admin Featured Image Thumbnail in CPT Edit Screen

I have a custom post type for a slider and I'm using the Featured Image thumbnail uploader to set the image. I've relocated the Featured Image meta box to be underneath the title section in the ...
0
votes
2answers
696 views

Display child pages on a parent and child page using Featured Thumbnails

How would I display a list of my child pages using featured images on a its parent page as well as its other siblings child page? For example, if my parent page is called 'Music', I'll have my main ...
0
votes
2answers
272 views

featured image inside post

I want the featured image of a post to display not only in the blog list view, but also inside the post (when i press "Read More..."). How do i do that? I pasted this if ( has_post_thumbnail() ) { ...
0
votes
2answers
116 views

Featured image for news page

Is it possible to display a featured image on a news page that uses index.php? I'm currently using wp_query to display posts from a specific category on the news page. Each post has his own featured ...
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 ...
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 ...
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, ...
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, ...
1
vote
1answer
2k views

How to add post featured image to RSS item tag?

I am able to add a post featured image to the RSS feed like so: function insertThumbnailRSS($content) { global $post; if(has_post_thumbnail($post->ID)){ $content = ...
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" ...
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 ...
3
votes
1answer
2k views

Programatically creating image attachments from local URLs and setting featured image

I'm currently working on importing an MovableType blog into WordPress. The blog has several thousand posts, and each post has an image associated with it. The export file contains references to each ...
1
vote
2answers
3k 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.
1
vote
3answers
575 views

Download an image from a webpage to the default uploads folder

I am writing a custom theme/site in which I need to download images programatically from certain webpages to the upload folder and then insert them as part of the post. So, I was able to find the ...
1
vote
3answers
7k views

Display thumbnail only on the very first post in the loop?

What's the best way to use <?php the_post_thumbnail();?> in my loop BUT only show a thumbnail on the FIRST post? Meaning, only the first post in the loop will have it's image shown? Here is an ...