Tagged Questions

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)

1
vote
0answers
91 views

Export xml use/import images from theme directory

Is it possible to create demo.xml for a theme that when imported into fresh theme installation will use/import images from theme directory folder (e.g. theme/images/demo) rather than import media from ...
1
vote
1answer
423 views

Function to auto-set a featured image that is already in use

I don't even know where to start with figuring this out.... This function for functions.php grabs the first attached image in a post and sets it as the featured image. The problem is that it will not ...
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 /** * ...
0
votes
0answers
84 views

Get source from the_post_thumbnail

I'm struggling because I'm using the "Sitewide Tags"-Plugin to grab all posts in a network to the main blog. Now I want to embed the post images to the main blog and the only function you're able to ...
0
votes
1answer
64 views

Assign SQL 'post_thumbnail' column as featured image

I have added a column called post_thumbnail to my wp_posts table. Is there any way I can make post_thumbnail to each post's featured image?
0
votes
1answer
57 views

Add 'if exists' to filter

This almost perfectly fixed an issue I had: How do I add the featured image to the_content after the first paragraph? However, if there isn't a featured image, the code still outputs a blank <img ...
0
votes
0answers
154 views

Image URL only for custom navigation walker (walker_nav_menu)

I'm attempting to build a custom navigation walker that pulls a page's Featured Image into the page's menu item. I intend to use the Featured Image as a background for the menu item (which is prettier ...
0
votes
0answers
172 views

Random Featured Image based on sub-category

I have this code below for adding a random Featured Image to a post in WordPress based on a category. (Thanks to G.M. on this WPSE post) I have two questions about it: First Question: It is ...
0
votes
2answers
29 views

add_theme_support not outputting thumbnails

so, i wanted to thumbnails in my query and i came across add_theme_support, it says you have to have that to enable actions such as thumbnail, so i put the following in my functions function ...
0
votes
1answer
459 views

how to resize thumbnail image

I am using this function to re-size my thumbnail , add_image_size( 'portfoliolarg', 120, 120, true); the image is corp and resize I just want to resize my Image
0
votes
1answer
40 views

Thumbnails for custom post not showing up in query

My thumbnails are not showing up in my custom post type when I do a query, however they show in the single.php file. I have added 'supports' => ...
0
votes
1answer
113 views

Change get_post_thumb responsively?

How can I responsively change the get_post_thumb when reaching a certain breakpoint with PHP code? I use the following code to print my posts thumb at the moment: <?php echo '<div ...
0
votes
0answers
65 views

Is it possible to upload multiple images via Media Library tab in Thickbox I've created?

I have a meta box upload button and I want to upload multiple images using that button. Firstly I enqueue required scripts: add_action( 'admin_print_scripts-post-new.php', 'mycpt_admin_script', 11 ...
0
votes
1answer
74 views

the_post_thumbnail do 2 queries. How to optimize

I have query: <?php $args = array( 'post_type' => 'post', 'post_status' => 'publish', 'orderby' => 'post_date', ...
0
votes
1answer
54 views

preg_replace not removed “class”

Use this code to remove the label "class" of the images, but does not work. The label does not disappear in the new post. function the_post_thumbnail_remove_class($output) { $output = ...
0
votes
0answers
9 views

Change crop position on featured image crop [duplicate]

I've set a featured image on my pages and want to crop them to a certain dimension. The problem is that it crops those dimensions in the center of the photo vs. from the top left (0,0) position. How ...
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?
1
vote
1answer
79 views

Watermark featured image as soon as it is set on post edit page

I want to watermark featured image of specific category when featured image is set on post edit page. I made a small script which watermarks but how can I know that featured image has been set so that ...
0
votes
0answers
103 views

Show recent posts thumbnail inside menu

I'm trying to develop a menu bar for a theme that, when the admin adds a category as a child on the menu, it displays the recent posts of that category. Example: I have a menu called "jobs" which has ...
0
votes
1answer
55 views

Make thumbnail from uploaded image without plugin

When I add image in post, I need to make some thumbnails with several sizes. Maybe someone could tell action or filter to implement this?
0
votes
1answer
81 views

cant output grayscaled ive created using add_image_size

I am trying to create a gray scaled image of the image i upload. I have been able to upload the image and create the gray scaled version by using this code: ...
0
votes
1answer
133 views

Only create image size when used in featured image

I'm using a post thumbnail size and I was wondering if there is a way to setup so wordpress only make the thumbnail size when the image I upload is used as the featured image rather than for every ...
0
votes
2answers
73 views

Wordpress auto picking featured image

In the past when I created a news post, the featured image was automatically assigned to the post when I uploaded an image in the post. But now, that doesn't work anymore :( The only thing that ...
1
vote
1answer
117 views

upload or auto setup feature photo by user avatar

I want user avatar image is set as a feature image, If there is no featured image. I am trying to do like this. function auto_featured_image() { global $post; if (!has_post_thumbnail($post->ID)) ...
1
vote
2answers
64 views

How to offset thumbnails to the center?

I made few thumbs size. But some of them make total resize of original pict or make new with specified sizes from right bottom corner. Is this posible to centrilize thumbs? I meen to make new thumb ...
0
votes
1answer
154 views

Custom header image, and content, on Posts Page in twentyeleven with Static Front Page

I'm new to Wordpress, so sorry if I've missed something obvious. I have a site using (a local child of) the twentyeleven theme. I've found that if I set Featured Images on pages and posts, then that ...
0
votes
1answer
3k views

How to add multiple featured image in meta box in post editor?

I would like to add multiple featured image in meta box in post editor area apart from default available featured image. I have added the meta box but i have no idea on adding the featured image ...
0
votes
1answer
247 views

How WordPress attaches its Featured Images with posts?

I'm working on a WP_Query(), where I'm trying to fetch all the images using 'post_type' => attachment and 'post_parent_in' => array( 1688 )(I want to pass some more post_ids) along with other ...
0
votes
2answers
264 views

Display Random Thumbnail from Category

I have a feeling that I'm on the right track, I just don't have enough solid PHP knowledge to get much further than where I'm currently at. I'm currently using the following code to return a list of ...
0
votes
1answer
268 views

3 random images from custom post type, each in a div with a diffrent class

I'm trying to build a loop using query posts to display 3 featured images from the custom post type 'portfolio'. My problem is that each picture has to be in a div with a diffrent class, so i was ...
-1
votes
1answer
37 views

add if statement to the featured image

I have a featured image. I want to add an if statement to the size. For example, if the featured image height exceeds 500px I want to add something. Is that possible ?
0
votes
1answer
473 views

Is it possible to add the_post_thumbnail to style.css?

I'm wondering if it's possible to add the_post_thumbnail location to style.css. I'm using these images as backgrounds, and I can easily do that on the template, of course, but I'm thinking that for ...
0
votes
0answers
87 views

6 Recent post on front page with either featured image or content image

In my frontpage.php i want 6 recent blogs with either featured image or the first content image, and if these are not available then i don't want to show that particular post. But i am not getting the ...
0
votes
0answers
144 views

Updated WordPress and now image crop, thumbnail setting and thumbnails are gone

I've updated to WordPress 3.7.1 and when I upload images to my site, it's not generating thumbnails. It's also missing the image crop and thumbnail setting sidebar. I created a simple theme but ...
0
votes
1answer
118 views

How to have featured image show in standard RSS Widget

Is there a way of showing featured images in the standard RSS Widget in WordPress?
0
votes
1answer
718 views

MultiPostThumbnails for Custom Post Type

I have spent time and figured out how to add Multiple Thumbnails to a custom post type in the wordpress admin for the custom post type, code and question below: if ...
1
vote
2answers
2k views

Add Title Attribute to WordPress Image the_post_thumbnail

i use this code to show post's thumbnail in my site but this code cant show the title Attribute of the thumbnails. how can i add Title Attribute to WordPress thumbnails? <?php if ( ...
0
votes
0answers
86 views

Pointing Existing featured images to s3 bucket

Our wordpress site is moved to another server and we moved all the images to amazon s3. Updated the post_content and guid to s3 path. On verifying found that the images which are set as featured ...
0
votes
1answer
159 views

Better way to show Description and image Captions

I am using this code to display "Featured Image" Captions/Descriptions, also i will show my div with Captions/Descriptions only if they exist. Because my PHP skills are not best My question is : Is ...
0
votes
1answer
153 views

Determine if get_the_image has image on Get the image Plugin

is there a way / function to determine if Get the image plugin successfully grab the image from post? Something like has_post_thumbnail on WordPress featured image. I need to know if featured image ...
1
vote
1answer
38 views

How do I turn a post thumbnail into a background image?

I believe the answer o this question was posted on this page, but it is still not clear to me. The snippets are scattered all over the discussion and several glitches happen when I implement them.
1
vote
2answers
119 views

Reactor Theme: Prevent Post Thumb on Post

Reactor Theme is built on Zurb Foundation and is here - I think it's quite good. The theme I am replacing used the featured image in the posts or blog page but not in the post itself. Reactor calls ...
0
votes
1answer
190 views

Show posts image attachments

I'm creating an archive page for my photoblog. My posts have 1 or more images. I'd like to show all the attachment thumbnails in a page. Using the featured image (the_post_thumbnail) only shows 1 ...
0
votes
1answer
35 views

How to enable admins/editors to set a featured image for specific category?

Well , I know how to set up a featured image for a post . But I want to set up a featured image for categories . So admins/editors can choose a featured image ,like they do for posts . And one ...
1
vote
1answer
771 views

set a chosen image-file-input as a featured image from wp frontend

SCENARIO : I allow to create posts from front-end. The form also has four image upload fields. I use the code pasted below for image attachments and setting the post thumbnail. //insert attachments ...
0
votes
2answers
573 views

Display the first image from a post in RSS feed

I have seen another question located here, but it's not useful for my case; it's not working. Also, "RSS Feed Image" plugin is not working as desired. I want to display the first image of the post in ...
0
votes
3answers
91 views

Show Featured Image in else statement

This is how i am loading the post thumbnail image ? What if there is no image, i want to show a default image ? How can i show that. Here is the code i use to display thumbnail. $html .= ...
-1
votes
1answer
939 views

How to find attachment by it's name?

Is it possible to get attachment id by its name? And at once may be it's possible to get parent post, to which this attachment is assigned?
0
votes
1answer
25 views

Link from Thumbnail to Post not working

i am trying to link my posts thumbnail to the post that it is pulling, however its not coming through as a link :S <?php $carouselPosts = new WP_Query(); ...
0
votes
1answer
19 views

Set featured link not showing

I created my own custom wordpress theme now i am able to add media to my site but the "set featured" link does not show, please i need some help on this.