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)

3
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?
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 ...
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
3answers
4k views

set_post_thumbnail_size in percent, not pixels?

I've created a new custom post type and I need the post thumbnails or featured images generated by the get_the_post_thumbnail() function to be set in percent, rather than pixels, as I'm using a fluid ...
3
votes
3answers
1k views

Set Featured Image programmatically (in admin) with JavaScript?

I'm trying to set the post thumbnail (featured image) with javascript from an existing image in the media gallery. I would consider a php-based option too I suppose (one that would require clicking ...
3
votes
3answers
2k views

Black and White thumbnails

There are ways to convert color image to black and white on the client side with javascript. However, it won't work in all browsers and it's slow. Is there a way to convert Wordpress post-thumbnails ...
3
votes
2answers
338 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
1answer
212 views

How to get_posts having post thumbnail?

I have following code: $posts = get_posts(array( "meta_key" => "special", "meta_value" => "surprise", // "has_post_thumbnail" => true, // how to do that? )); What should I do to ...
3
votes
2answers
355 views

PHP/Manual use of images? - 2 Questions

I've made a quick PHP script/page that uses the wp_insert_post() function to insert a post directly. And this works great. The post I am manually adding has an image in it, so I firstly ...
3
votes
7answers
7k 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: ...
3
votes
1answer
4k views

how do I determine which image is the featured image in the database

I've queried all children of the post, and two records are shown. This is ok because there are 2 images in the gallery, but I can see no field in the database which makes it clear which one is the ...
3
votes
2answers
2k views

Horizontal scroller with post_thumbnail's

Attempting to create a horizontal scroller using post_thumbnail's. I've made a filterable portfolio section using this tutorial: http://www.wearepixel8.com/blog/filterable-portfolio but my attempts ...
3
votes
1answer
1k views

How can I add a set featured image function to a theme that doesn't already have it built in?

I'm a relative newbie to WP and PHP in general, but now that I'm into it, I've caught the "WP fever" and have ditched asp.net. I finally found a quality theme that I like and I'm considering buying ...
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. ...
3
votes
2answers
2k views

How to display the_post_thumbnail if a post has one or otherwise display the first image in a post?

I would like to create a condition that checks to see if a post has a thumbail and if it does display it, otherwise display the first image in a post. I tried something like this in my loop.php but ...
3
votes
2answers
412 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
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 ...
3
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 ...
3
votes
2answers
3k views

Best way to filter featured image text for a custom post type?

I am trying to change the "Set featured image", "Remove featured image", and "Use as featured image" text links of a custom post type for my plugin Meteor Slides. I found the ...
3
votes
1answer
108 views

In loop: posts have thumbnail AND other variables

I am looking to display posts that meet certain requirements. First and foremost, the idea is to show visitors the most viewed posts. I implemented that with some help. So, I got that working with the ...
3
votes
2answers
84 views

Change wording of default thumbnail metabox

I want to change the wording in the Default thumbnail metabox to 'Set default thumbnail' instead of 'Set featured image'. How can I do this?
3
votes
3answers
810 views

Specific featured image for each category

I´d like to set specific featured image for all posts in one category. So, if I have category Good Jokes, all posts in category Good Jokes will have the same featured image displayed in front page. ...
3
votes
2answers
956 views

Get featured image on Blog Index

I've been trying to use the "featured image" from the home (the blog index) with no luck. It's working for every single page, but it's not working for the home. The code looks something like this: ...
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 ...
3
votes
1answer
1k views

How can I add the “Use as featured image” to a custom metabox?

I am implementing a custom Meta box that allows the user to add images via a simple file input field (based around code on this site: Meta Box Script). This code allows multiple images to be added as ...
3
votes
1answer
99 views

Featured Image Inherited from Parent Page

What I would like to do is have my parent page's featured images display, unless a child page has its own featured image, then I would like that image to become the featured image from that page and ...
3
votes
2answers
464 views

Set featured image for multiple posts

Does anyone know how I can set an image as featured image for multiple posts. I have posts in a seri that I would like to use the same image as featured image. bulk edit doesn't have featured image ...
3
votes
1answer
7k views

wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); Getting thumb from wrong loop

I am using a plugin which sets the thumbail for your fb share image. The src is <?php echo wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); ?> Which was working fine, but not ...
3
votes
2answers
933 views

Linking thumbnail to full size image

I use a function in my blog (getImage) to call thumbnails in the loop (it calls the 1st image on the post) but instead of link to the post, i would want the thumbnail to link to its full image src. ...
3
votes
2answers
523 views

how to test for attached image

I am trying to find out whether or not a post has images. If it does, I then want to know if a featured image was specified for the thumbnail - if not, the get_thumb() function will assign an image ...
3
votes
1answer
439 views

Double thumbnails?

is it possible to use the thumbnail mechanic twice? I find the thumbnail API really useful for allowing users to place in there own graphics, so that I can control size and position easily. All they ...
3
votes
4answers
2k views

How can I display my featured image correctly inside my single posts?

Here is what I have tried: 1) Added add_theme_support('post-thumbnails'); in functions.php. 2) Added <?php the_post_thumbnail(); ?> inside single.php which looks like this: <?php /** * ...
3
votes
1answer
820 views

Allow user to manually set crop area of default/custom image sizes on upload

I'm looking for a plugin that allows the user to define where the image will be cropped for a given thumbnail size. For example, the user uploads an image, a screen comes up with the image and a ...
3
votes
1answer
569 views

Custom post type thumbnail / Media Library WP_DEBUG notice [closed]

My custom post type thumbnail appears to be working correctly. However, when I return to edit one of my species profiles (in the Admin area, not talking about the front-end here), the following text ...
2
votes
4answers
24k 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 ...
2
votes
2answers
3k views

Query posts only with featured image

I want to query 6 posts, but only those which have a featured image attached. I am using meta_key method for this with WP_Query as such: $args = array( 'post_type' => 'post', 'meta_key' ...
2
votes
3answers
1k views

can the_excerpt function also get images?

Not sure if im going about this in the right way but, overall, ive been told to create, kind of like a news box on my home page and so, the "latest news" is going to be this clients posts. now i know ...
2
votes
3answers
5k views

How to remove “featured image” functionality from a custom post type?

I have made a custom post type for a child theme. I removed "thumbnail" from the supports array in functions.php and that prevents a featured image meta box from being displayed. However, when in the ...
2
votes
3answers
1k views

the_post_thumbnail fallback using hooks

I am using this big theme that is almost entirely relying on widgets and sliders. Now I trying to avoid looking for post_thumbnail output code in all the included files in order to achieve fallback ...
2
votes
2answers
349 views

How to handle thumbnails

How should I handle post thumbnails? Do most people put them in custom fields? Use a plugin? How do themes on ThemeForest handle this? Also different theme will have different size requirements? So ...
2
votes
3answers
2k views

Showing a placeholder/default img, if no featured image is set

I need to modify the following code to show a placeholder if there is no featured image available. I understand that I need to add a if statement in the following code but wasn't sure of the exact ...
2
votes
1answer
8k 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 ...
2
votes
2answers
2k views

Displaying Child pages of the current page in post format and their thumbnails (featured image)?

I'm using the following code I got from the Wordpress codex: <?php // Displaying Child pages of the current page in post format $mypages = ...
2
votes
2answers
621 views

Implementing Zurb's Interchange Into Wordpress

I'm really scratching my head trying to figure out the best method for responsive images with Wordpress. Zurb just released a new javascript plugin for their Foundation framework. I'm using Foundation ...
2
votes
1answer
145 views

Skip posts without a thumbnail in loop

I want skip every post that has no thumbnail. The code does not work properly yet. Actually the script doesn't show posts without a thumbnail - that's good, but in the loop the post with no thumbnail ...
2
votes
2answers
385 views

Resizing Images to lower Disk Space Using Plugins

I'm trying to take existing images and shrink the file size down by resizing to photos to a smaller resolution. I've tried a few methods so far: Simply editing the photo in photoshop and reuploaded, ...
2
votes
1answer
2k views

How to crop thumbnail height to auto with set width

I'm looking for a way to only set the width of a thumbnail size and let the height set auto. So if I have two images. One is 600px/420px and one is 600px/600px. I want to set only the width of the ...
2
votes
1answer
3k views

Convert uploaded PNG to JPEG automatically

Is there a way to convert automatically uploaded PNGs to JPEGs and keep the original? In other words, let the user upload a PNG, but show in wordpress (thumbnails, large, medium, etc) the JPEG version ...
2
votes
1answer
499 views

Add a featured image in my theme?

I'd like to add a Featured image to a default article or a Custom Type Post in my theme but I don't get the area of the highlight image, why? In the default theme the option is present but not in my ...
2
votes
1answer
7k views

Featured Image Panel Missing From Custom Post Type in Wordpress 3.2

Upgraded to 3.2 from 3.1 and lost the featured image panel in admin that was running in a custom post type. add_action( 'init', 'create_my_post_types' ); function create_my_post_types() { ...