Questions tagged [post-thumbnails]
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.
157
questions
2
votes
1
answer
5k
views
Show current page featured image in sidebar
How do I call the current post's featured image in the sidebar? and if there is none, then a backup image?
2
votes
2
answers
2k
views
No srcset for hard-cropped thumbnails
I am using hard-crop on featured images like this :
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size ( 635, 200, true );
I have no other plugin installed, not even Jetpack.
No matter ...
2
votes
4
answers
7k
views
Fallback default image when there is no featured image
I have tried many options but without luck. It should be very simple approach but does not produce results. I am trying to insert default fallback image if there is no featured image in the post. My ...
2
votes
2
answers
443
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
4
answers
9k
views
How to change _wp_attachment_metadata specific value in SQL?
i had to resize a lot of existing images in my upload folder (around 1k). After reuploading them, Wordpress of course, doesn't recognize the new dimensions. My approach was to just change the size in ...
2
votes
2
answers
771
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
3
answers
6k
views
How can I get a different image size, if all I have is the link?
For various reasons, I can't use Wordpress' built-in Thumbnail functionality.
What I want to do instead is to use the first image in the post as the thumbnail.
Here's what I found in the codex: Show ...
1
vote
1
answer
781
views
Adding Featured Image to Post programatically
How do I add a Featured Image programatically, given the URL/filename of the image, and Post ID associated with it?
1
vote
1
answer
2k
views
Wordpress resizes image to the same size as uploaded
I am writing a theme which uses different image sizes.
Here are my targeted sizes as they are set up in under Settings > Media in WP Admin:
Here is the functions.php code for the thumbnail support:
...
1
vote
1
answer
440
views
How to upload imagick resource to media in wordpress
$filePath = wp_get_attachment_url( $id );
$tempfilename = explode("/", $filePath);
$temppdffile = end($tempfilename);
$cuurentPath = plugin_dir_path( __FILE__ ).$temppdffile;
$im = new Imagick();
$im-&...
1
vote
1
answer
2k
views
image srcset returns false
I have a custom post type. Inside loop of single post template I'm trying to show a featured image with custom srcset attribute.
My image sizes are:
add_image_size( 'i600', 600 );
add_image_size( '...
1
vote
1
answer
507
views
Insert Featured image from Feed
I am importing products through a feed programmatically as follows:
$request = wp_remote_get('myapiurl');
$response = wp_remote_retrieve_body( $request );
// decode the json
$json = json_decode($...
1
vote
1
answer
3k
views
How to use SRCSET with get_the_post_thumbnail()?
My wordpress theme uses get_the_post_thumbnail() to display Thumbnails on Posts.
I have set custom image sizes but running it through Lighthouse gives following error.
Serves images with low ...
1
vote
1
answer
5k
views
Delete all post meta except featured image
My aim is to clear up my database entries.
I did a migration from blogger which added many useless post_meta.
I found a plugin (db reset) that has the option to reset/delete all post meta. However if ...
1
vote
0
answers
465
views
automatically set "Featured Image" the same as the og:i that is set in a custom field
I currently have a site that uses the "custom fields" feature to set the value of the meta property="og:image" for each post. All of my og:images are stored on an external server.
I'm looking for a ...
1
vote
2
answers
4k
views
Using Gutenberg block components in admin interface controls
I asked a previous question, and got a helpful answer that got me going quite a ways. The present problem is unrelated, but IMO reflects the dearth of documentation suitable for those of us who aren't ...
1
vote
1
answer
310
views
Is it possible to prevent users from uploading small images?
Is there a way to prompt an editor whenever they try to upload an image smaller than 350px width? Essentially rejecting any image uploads that are smaller than 350px width?
Thanks
1
vote
1
answer
3k
views
add_image_size and add_filter('image_size_names_choose', 'my_custom_image_sizes') not working with wordpress 3.5.2
I'm tearing my hair trying to get additional image sizes appear in the media section when i upload new pictures. It works on older versions of wordpress but i can't get it to work on v 3.5.2
Here's ...
1
vote
1
answer
2k
views
How to get custom image sizes into media uploader dropdown?
I searched net to solve the problem with images size uploaded from media.
But not even one worked to me.
When I try to insert images from the media into post it does not show my custom image size 608 ...
1
vote
3
answers
943
views
Bind to WPSetAsThumbnail
is there a way to bind some extra script to the WPSetAsThumbnail function? the function automatically inserts the image into the post's metabox, but what if i wanted to do something else with it? ...
1
vote
1
answer
11k
views
Set featured image size for a custom post type
I have a custom post type, and I'm adding support for thumbnails (featured image)
register_post_type('cp_companies', array(
'labels' => array(
'name' => __('...
1
vote
1
answer
357
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 ...
1
vote
2
answers
586
views
How can I migrate all of my custom field thumbnails to the built-in post featured image?
I am running a theme on my Wordpress install that was built for Wordpress 2.8, prior to the time that Wordpress started using featured images for posts. I am switching to a theme that was built for ...
1
vote
2
answers
4k
views
Filter For Featured Image
Is there a filter for when a Featured Image is set/unset or changed.
I need to delete transient data when the above occurs.
1
vote
2
answers
3k
views
Add a Post Thumbnail to an RSS Feed with custom size
I have two different blogs on the same domain and my goal is to get the 3 latest posts from blog1 to show on the home page of blog2. Everything goes well following these instructions: http://www....
1
vote
1
answer
27k
views
Displaying a featured image (only img url) as the img src?
I have the following code:
if (themedy_get_option('product_gallery')) { add_action('genesis_post_content', 'themedy_product_images', 1); }
function themedy_product_images() { ?>
<?php
...
1
vote
1
answer
11k
views
How to display a post's Featured Image with this code?
so this is sort of a continuation of another question that I had to ask recently. I wanted to start another conversation, since technically my last question was answered. The last question is here: ...
1
vote
3
answers
312
views
Thumbnail with different sizes
I want make all my blog thumbs the size of 227x133. I need images width have 100% (for responsive design). Some images have width greater than the other and vice versa.
I'm using this code to show ...
1
vote
3
answers
5k
views
Add post thumbnail from external image with plugin
I'm currently writing a plugin modifying the post content with the wp_insert_post_data filter. While doing that I would also like to add a post thumbnail using an external image url. It doesn't really ...
1
vote
2
answers
4k
views
Can't Display Featured Image in RSS Feed
I'm currently working on a test website on my local server using WordPress version 3.4.2. I've tried various different solutions. Some have included installing various plugins, such as WP RSS Images ...
1
vote
2
answers
4k
views
how to change my child theme featured image dimensions?
I am developing a child theme based on the twentyten theme and now i notice the featured image in the WP backend (wp-admin) shows the wrong scaled image.
It shows the "twenty ten" size, meaning an ...
1
vote
4
answers
8k
views
How I upload, save and set a featured image from my frontend?
I have a form on my site.
This the user register one missing person.
I created a custom post type missing person, custom taxonomies, and custom fields.
All this input's save as well in wp.
But I ...
1
vote
1
answer
722
views
Upload image from a URL and assign it as a Featured Image to a Custom Post Type?
I am 90% done building a plugin that uses the Amazon.com API. What I have built is a Books Custom Post Type.
My Books CPT has Custom Taxonomies for Book Category, Book Tags, Book Author, and Book ...
1
vote
1
answer
1k
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
1
answer
244
views
set_post_thumbnail or media_sideload_image adds image multiple times in media library
I am trying to add the featured image to posts and that works, however, the featured image is apparently set everytime I check my post.
<?php
$post_id = get_queried_object_id();
$bla = "...
0
votes
1
answer
147
views
image_size with respect to aspect ratios
I have image assets that I load externally and insert programmatically. There are 3 different asset classes:
landscape, portrait, and 1:1
The default image_sizes are creating a lot of clutter that's ...
0
votes
1
answer
633
views
How to use images uploaded with custom implementation of thickbox like the_post_thumbnail() functionality
I have create a custom post type with meta boxes.
In metaboxes I have create some fealds that the use can use the WordPress ThickBox Media Dialog to upload his/her images for each post seperatly.
...
0
votes
1
answer
979
views
Set (featured) thumbnail for post?
I'm using wp_insert_post and media_sideload_image to create a post and attach a single image to the post. However, how can I mark this attached image as featured thumbnail? It would make listing the ...
0
votes
1
answer
1k
views
Multiple Post Thumbnails plugin and attachment error
This question specifically deals with the Multiple Post Thumbnails plugin, though the problem may have to do with my installation of WP itself as nobody else seems to have had this problem.
I am ...
0
votes
0
answers
100
views
Trouble adding custom featured image for custom taxonomy TERMS
Wordpress version 5.2.2
Local development - WAMP
PHP version 7.0.1
I am building car dealership website.
Goal:
Set featured image for custom taxonomy - Body Types
Set featured image for custom ...
0
votes
2
answers
383
views
Facebook is only displaying preview thumbnails that are 100px from my posts?
I'm using Facebook and Digg Thumbnail generator and [FaceBook Share (New)],
2
As you can see if the image is 100px the thumbail is displayed when I press the share button:
But with an image with ...
0
votes
1
answer
1k
views
display WP image posts in Bootstrap 4 modal
I have a series of image posts displayed on a page of a WP site that uses Bootstrap 4
The images normally display in a larger size when they're clicked on but I want to display them in a dropdown ...
0
votes
2
answers
43
views
How to show scaled featured image in template?
I need to show the post featured image at the desired position on my theme template. At the same time, I need its width to be 300px and the height- adaptive.
What code should I add to my template?
0
votes
2
answers
1k
views
Featured Images on Front Page
I currently have a static front page and a /blog.
My goal is to have the front page be a grid of hand selected images (similar to a portfolio). I would like to be able to easily switch the images are ...
0
votes
1
answer
864
views
How to show a featured image as current?
On the right rail here: http://www.julianamaeberger.com/soma/sample-testimonial-3/ I am showing a random post "Testimonial". Below that I am showing all featured images for the category "Testimonial" ...
0
votes
4
answers
7k
views
How to make thumbnail images click into blog posts
How do I make it so the thumbnails in the list of blog posts on my blog are clickable, so that when the user clicks the thumbnail image, the blog post opens up?
If it helps, this is the blog: http://...
0
votes
1
answer
4k
views
Download button for Featured Image in every post - automatically
I want to add download button for featured image in every post automatically in WordPress with the usage of php files. I don't want to use shortcodes, custom html in every post or plugins, cause I ...
0
votes
1
answer
285
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
1
answer
1k
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
2
answers
3k
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 ...