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.
3
votes
5answers
829 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 ...
3
votes
1answer
370 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
2answers
201 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 ...
3
votes
1answer
1k 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 ...
3
votes
1answer
334 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
...
3
votes
1answer
489 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
3answers
604 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
2answers
288 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
2answers
537 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?
2
votes
3answers
1k 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' ...
2
votes
3answers
459 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 ...
2
votes
3answers
1k 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
2answers
1k 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
1answer
970 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
386 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
712 views
Check for featured image in WP_Query
Is there a way to filter posts by featured image when initialising a WP_Query object?
Example
$my_query = WP_Query(array("has_thumbnail"=>true));
or, more ideally
$my_query = ...
2
votes
1answer
944 views
get_the_post_thumbnail() doesn't taking style attribute
This seems to be an easy one but its giving me quite a hard time. get_the_post_thumbnail() suppose to take attribute as an array. Well, everything working right but when i pass style attr its doesn't ...
2
votes
1answer
2k 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 ...
2
votes
2answers
38 views
Setting featured image with function, 1 part not working
I'm trying to set a post's featured image based on custom fields. There are different types of posts and therefore the featured image should be set depending on which custom fields have been filled ...
2
votes
2answers
135 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
95 views
Adding a custom field or metabox to the post-thumbnail widget?
Is it possible to add a custom field to an existing "widget" in the backend?
What I wanna do is provide a way to have a checkbox to apply a thumbnail that is double the size of the normal one on the ...
2
votes
3answers
609 views
How to change the height of featured image in Twenty Eleven child theme
I am trying to change the height of my featured image to 350px in my child theme for Twenty Eleven.
Can anyone help??
Note: I am using Twenty Eleven and there is no functions.php file in my child ...
2
votes
1answer
114 views
Why are extra 92 pixel square thumbnails created?
Disabling this WordPress feature which automatically generates various sizes of an uploaded image, is normally as simple as going to WordPress Dashboard > Settings > Media screen and changing all ...
2
votes
1answer
410 views
Change Output for Images in Content
I want to wrap some html (divs and classes) around the tag (to create the appearance of photo corners by way of an image sprite).
Basically, I want to re-write all tags added by WP in the content ...
2
votes
1answer
3k 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() {
...
2
votes
1answer
1k 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 ...
2
votes
3answers
3k 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 ...
2
votes
2answers
102 views
How to scale up post thumbnails/featured image?
Is there a way to scale up post thumbnails on Wordpress?
On a featured div I want a post thumbnail/featured image with 584×348 px. When I upload a smaller image as a featured image on a post, it ...
2
votes
2answers
168 views
User facing form to upload image on wordpress
I have a client who bought a wordpress theme that is built for posting job listings, a user can create an account and then post job listings but my client wants it converted to post Wheel listings ...
2
votes
2answers
854 views
How to change post thumbnail title and alt attributes to post title?
Can we change the title and alt attributes of the_post_thumbnails and set them to post title instead ? like creating a function for it and adding a filter ? I tried searching but I can't seem to find ...
2
votes
2answers
745 views
Cropped thumbnail still displaying as full image
Steps to reproduce...
1) Add to functions.php:
add_image_size( 'half-size', 200, 200, false );
2) Add to template file (inside loop):
<a href="<?php the_permalink(); ?>" title="<?php ...
2
votes
2answers
1k 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 ...
2
votes
2answers
727 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.
...
2
votes
1answer
1k views
How to create thumbnails with a fixed width, so all of them will have the same width?
right now, a thumbnail will be either 150px in height or in width, depending if it's landscape or portrait. Is there a way to make them always the same width and scale them in height accordingly, ...
2
votes
1answer
1k views
adding an id to the_post_thumbnail
I'm attempting to use the 'feature image' feature of Wordpress to make a full screen background, that resizes to fit the browser window using jQuery
The bit I'm stuck on is adding a custom id ...
2
votes
1answer
178 views
How to List Thumbnails based on Custom Categories
I need to list(display) all thumbnails from my Custom Post Types in a page template based on product categories. For Example I have a Custom Category called "Art" and some images(Custom Post Type) ...
2
votes
1answer
203 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 ...
2
votes
2answers
185 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:
...
2
votes
1answer
127 views
reference the current category being used in the category.php page
I have this code in my category.php file
<?php query_posts( array('post_type'=>'featured' ));
$featured = new WP_Query( array('posts_per_page'=>1, 'tax_query'=> ...
2
votes
1answer
440 views
Can a thumbnail of an animated gif be animated?
I have an animated gif I want to show in two places, having two different sizes.
I am creating two sizes in my functions.php, using
add_image_size( 'small-feature', 500, 300 );
add_image_size( ...
2
votes
1answer
550 views
Image uploader with “Set Featured Image” link on front end
I am loading upload-media.php file using thickbox on front end where user can upload images to the post.
Question: How to I trigger the upload-media.php so the link "set featured image" shows up on ...
2
votes
1answer
247 views
Set WordPress Featured Image For All Post Slugs Matching Image File Name in Specified Directory
I have a bunch of old posts on a blog that I would like to assign a featured image to.
I have retrieved all the images I would like to use for each post.
I saved each image file name after the slug ...
2
votes
1answer
527 views
List category posts - Thumbnails are not displaying
we've been using List Category Posts to display different category posts on one page and it was working great until recently when the thumbnail images disappear. The 'thumbnail=yes' option is there. ...
2
votes
1answer
394 views
Archive Thumbnail Gallery
I am trying to create a Archive page with a list of all my posts with thumbnail and a small excerpt underneath.
kind of like what this guys is doing
...
2
votes
2answers
807 views
add_image_size for post type
I currently have this in my functions file, which works as expected:
// Enable Post Thumbnails
add_theme_support('post-thumbnails');
// Custom Thumbnail Sizes
add_image_size( 'square-small-thumb', ...
2
votes
1answer
553 views
How can I make post fields required in Wordpress?
I am setting up a Wordpress site as a CMS and trying to figure out a way to make certain post fields "required" before an author can publish a post.
In particular, I want authors to be required to ...
2
votes
2answers
2k views
WP Insert Post function - Insert Post Thumbnail
Whilst performing wp_insert_post, how would one insert the post thumbnail. I tried the code below to no avail.
$postit = array(
'post_title' => $itemtitle,
'post_content' => '',
...
2
votes
1answer
748 views
Display All Post Attachments and Assign Class to the Last Image?
I have a function get_images() in which I would like to display all image attachments for the current post (or page) in a list with the last image having a class="last" attribute to mark it as the ...
2
votes
1answer
20 views
How to remove thumbnail sizes for specific post type on a child theme?
The theme I'm using includes a slideshow that generates an additional 4 image sizes for every image that is uploaded. I don't need to have all those images being generated for every image.
Is there ...
2
votes
0answers
51 views
Hide upload image fields for the different media upload popups
I am trying to change a few of the options in the Set Featured Image popup in the Wordpress admin. I can't seem to find anything that determines if the popup window is a Featured Image or an Add Media ...