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)

0
votes
1answer
42 views

How to add a featured image to a existing post via php?

I'm having trouble to add a featured image to an existing post via PHP. The image resides on wp-content/upload folder. The script i'm doing, is not a plugin, theme, or something like that. It's just ...
0
votes
1answer
59 views

Can I use a Custom Field as the Featured Image URL?

Each post of my blog has a Custom Field which is the URL of a photo on Flickr. How can I use it as the Featured Image? Please note I'm asking this question because I'm migrating to a theme that makes ...
0
votes
0answers
85 views

SQL Query to select post thumbnail, post title, post content from a category

I use the db of my wordpress blog to develop a mobile application in Java. For this, I need the SQL query to display the thumbnail of a post, the title and the content in a selected category. I think ...
0
votes
1answer
32 views

how can I call a posts featured image in any template?

I would like to call specific images in my template from the posts and pages of my choosing. For example I want to these featured images on my home page; About page Project post Another page I ...
0
votes
1answer
27 views

How to display thumbnail if post is assigned one otherwise not

I would like to display the most recent post in a block, and if the post is assigned with a thumbnail I would like it to be shown on the left to the post content. This is my code that I have been ...
0
votes
1answer
47 views

featured image box missing

The 'set featured image' box is not showing up at my 'Posts' and 'Pages' edit page. There is also no checkbox in my screenoptions. I have add_theme_support( 'post-thumbnails' ); in my functions.php ...
0
votes
1answer
92 views

Post Thumbnail on Single (if elseif else)

I have the following news articles on the frontpage of a website I'm currently working on: For this I'll need to write two simple PHP if statements, which I've already done successfully, but on the ...
0
votes
1answer
48 views

get_the_post_thumbnail($post->ID, 'thumbnail'); not working. How can I solve this?

I am using the following code to display the posts on my home page. But I could not print thumbnails using get_the_post_thumbnail($post->ID, 'thumbnail'); any help to solve this will be very much ...
0
votes
1answer
33 views

Size article thumbnails and retrieve them directly from database

I've integrated the Wordpress database directly with my .NET application. What I want is to set the featured image of a post. This featured image must be maximum 800pixels wide, and automatically ...
0
votes
2answers
40 views

Default featured image set as background image [closed]

I'm using the following code to set my post featured image as a background-image… <?php if (has_post_thumbnail( $post->ID ) ): $image = wp_get_attachment_image_src( get_post_thumbnail_id( ...
1
vote
1answer
77 views

How to set the jpg image compression for specific thumbnail sizes?

This question was asked on Set JPEG compression for specific custom image sizes and answered very nicely by Ahmad M I'd of course comment to that thread but I don't have 50 point reputation... The ...
0
votes
2answers
62 views

How can i give a download link to the thumbnail or featured image

I am using the code below to give users download the thumbnail image, as i have a wallpapers site: <a class="downloadbutton" href="<?php echo $src[0]; ?>" download="imageName">Download ...
0
votes
2answers
49 views

Post Image not displaying in category view

I tried adding an thumbnail sized image in the very first line of the post so that I want my category list search should display with this thumbnail and some text with "read more" button but this ...
0
votes
1answer
30 views

How can I list posts with different formats depending on order?

Let's say I have a regular main page listing posts, like in any regular WP blog. Now, I'd like to achieve this: if it's the first post in the list, use some layout, if second, another layout, if ...
0
votes
1answer
50 views

Black and White Thumbnail in WordPress Gallery

I want to have black and white thumbnail on page, and i want to show image in colour when mouse is on and when big image is shown (in lightbox) I have this -> ...
2
votes
2answers
56 views

How to Set Featured image In Wordpress without Showing it into Post?

I just want to set featured image of my post but don't want to show it in my post. How can I do that? Detailed : I want to post to show its thumbnail in main page but not to show it when we expend ...
1
vote
0answers
32 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
121 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
455 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
34 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
45 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
30 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
53 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
77 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
27 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
70 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
29 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
50 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
40 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
41 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
33 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
8 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
77 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
48 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
70 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
45 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
39 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
71 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
0answers
39 views

WordPress Featured Image on Custom Import

I'm working on customizing import plug-in and I'm facing hardness assigning a featured image while importing the data. I'm uploading the images to a custom folder via FTP and each post in the CSV ...
0
votes
2answers
63 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
75 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
44 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
116 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
730 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
117 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
99 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
185 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
33 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
232 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
61 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 ...