Questions tagged [thumbnails]

Automatically generated smallest size of an image.

Filter by
Sorted by
Tagged with
1
vote
1answer
3k views

wp_get_attachment_image() not working when trying to add width and height attributes

I am using wp_get_attachment_image() to try and output an img tag with width and height attributes. Here is my code: $thumb_src = wp_get_attachment_image( $id, 'thumbnail', false, array('width'=> ...
2
votes
1answer
32 views

Completly disable and remove Thumbnails?

This is my first question, so forgive me if it's not perfect 😅 I am asking, if there is a way, to completely disable and remove the thumbnail functionality from WordPress. (I am using an image CDN ...
1
vote
0answers
14 views

How to stop thumbnail generation from some images and different size thumbnail generate

I have 4 Post Type, and each Post Type has images with different size. Is it possible to choose not to create thumbnail images when uploading an image or to create specific images size for each post ...
1
vote
0answers
11 views

Update old Post image metadata to 'thumbnail' wp_attached_file

I am updating a very old WP-based website that was created prior to WP use of "featured images" aka thumbnails and the name of all post images are contained in a custom meta-field called "Image" (...
3
votes
2answers
5k views

Display only posts with thumbnail using WP_Query

I'm having hard times with showing only posts which have featured images using the loop. My PHP level is basic and any help will be really useful. So basically this is my original code : if( ...
0
votes
0answers
17 views

Delete original images after resize

I've read previous questions about the argument but, it seems no one perfectly fits with my goal. I've noticed that, after uploading an image, Wordpress, correctly, creates all the thumbnail needed. ...
0
votes
1answer
445 views

Thumbnail images missing in WP media library

I have built my own WordPress theme and applied it to my WordPress website. The issue I am having is out of the blue, the thumbnail images from the media gallery have stopped loading in and now just ...
0
votes
1answer
15 views

Add custom version to an image

I have scoured the web for plugins and articles to help me solve something that seems pretty basic, but couldn't find anything. I want a way to create custom versions, particularly sizes, of an image ...
1
vote
2answers
2k views

How to use thumbnail size of image if I'm only using src to get image

I have a custom field for an image, and using it this way: <?php $item_img = get_sub_field('image'); ?> <img src="<?php echo $item_img ?>" /> But I want to use the thumbnail ...
0
votes
2answers
1k views

Adding thumbnail to search results & changing content.php

Looking to discover how to alter my content.php code to add the thumbnail image of the specific posts to my search results located here for example: https://divesummit.com/?s=suunto&submit=Search ...
1
vote
2answers
1k views

How can i place Feature Image under title field in wp-admin?

I am creating my custom Image slider, in register_post_type() -> i use : supports = "title,thumbnail"; i use only two thing in supports, "title,thumbnail" But post-thumbnails default position is ...
1
vote
2answers
5k views

How To Add and Display Category Image

I have created a WordPress plugin to create a widget area to display category names (total nmbr of post) and description.Now I want to show the category image just after the category name and after ...
0
votes
0answers
22 views

can i use specific images for thumbnails in post?

How do I use get_post_thumbnail_id for specific posts? I want to manually create a field with the ACF plugin and add it to the image post and replace "get_post_thumbnail_id". <?php if ( $the_query-...
3
votes
2answers
123 views

retrieve thumbnail from post ID of best selling product in category

The code below displays product category names, links and their thumbnails on hover. The thumbnails ($image) retrieved are those manually set via the woocommerce product category menu. I am trying ...
0
votes
1answer
139 views

Disable wordpress image sizes generation

I'm trying to disable image sizes generation in wordpress. When I use: print_r( get_intermediate_image_sizes() ); it shows: Array ( [0] => thumbnail [1] => medium [2] => ...
0
votes
0answers
15 views

Why does my site download two different versions of the same image?

On both my homepage I have a masonry layout with thumbnails. These are lazy-loaded by JetPack. I noticed that for every thumbnail, two images are being loaded. One with a request url of https://i2.wp....
1
vote
1answer
20 views

hover image appears below placeholder instead of overlayed

I used padding-bottom calc to stop my text jumping around while the placeholder loaded. This worked, however the hover image which is supposed to display over the top of the placeholder, now appears ...
0
votes
1answer
614 views

Get a different size of Image thumbnail while working with custom metabox

I am using custom metabox for a page in my new project, I am using it for uploading image, and attaching it to the page. It's working fine, I can select image or upload the image using WordPress' ...
1
vote
1answer
100 views

combine Code 1 with Code 2

Code 1 - uses wp_list_categories to list product categories in columns of x categories up to a total of y, with a link to view all categories if there are more than y. Code 2 - Later realising i ...
0
votes
1answer
74 views

get taxonomy thumbnail and use it as a variable in code

Im having trouble trying to retrieve category thumbnails and use as a variable in some code i got from a JSFiddle. It puts a placeholder image as default and displays a category image on hover of ...
0
votes
0answers
23 views

How to pass a YouTube thumbnail URL through the a custom image size

I'm currently displaying YouTube thumbnails directly from YouTube using this format which works: <img src="http://img.youtube.com/vi/<?php echo youtube_id; ?>/maxresdefault.jpg" /> ...
0
votes
0answers
34 views

wp-cli wp media regenerate --only missing deletes unused sizes?

I just ran wp media regenerate throught 200k images... thing is I have 400k, and the range command is not working (200000 400000 | xargs ***) If I use wp media regenerate --only missing will it ...
0
votes
1answer
24 views

Disable globally “Crop thumbnail to exact dimensions (normally thumbnails are proportional)” with Multisite

I would like to disable the "Crop thumbnail to exact dimensions (normally thumbnails are proportional)" function for all blogs in my WordPress Multisite setup. This function is available in Dashboard,...
0
votes
0answers
27 views

Cannot display wordpress thumbnail

I wrote a simple Wordpress Plugin that upload all images inside a folder located on another server. The uploading process is working well, but for some reason when I go inside Library I have a blank ...
0
votes
1answer
533 views

the_post_thumbnail returns full sized image, how to debug?

This is a weird situation. I have defined add_theme_support('post-thumbnails'); add_image_size('190x280',190 , 280,true); add_image_size('400x600',400 , 600,true); Uploaded images to post as ...
0
votes
0answers
26 views

ADD class to all my images (thumbail)

I have a xxx web like xvideos for example. And I want to add a class to my thumbail images because I want to indicate that the pop up add only will active when they click in these images. So, i have ...
0
votes
1answer
33 views

Change thumbnail size for Media Library

I can't seem to find a way to change the size of the images in the Media Library. For some reason the full picture is being loaded in the media library, and this makes it really slow. I've tried: ...
0
votes
1answer
56 views

Custom Post type slider with thumbnail navigation

I am trying to make a slider for a custom post type with quite a few custom fields. Ive got the query and fields displaying fine. But now to get it into a slider Getting each post in the loop ...
0
votes
2answers
48 views

Stop WordPress compressing images? – Quality is terrible

I understand WordPress creates smaller versions of the original image file. These versions are blurry in comparison to the original which is a big issue as a photographer. I set up this page you can ...
1
vote
1answer
1k views

Add Thumbnail to wp_list_categories()

I'm using the following code to display a list of my taxonomy terms in my home page: $customPostTaxonomies = get_object_taxonomies( 'guide' ); if( count( $customPostTaxonomies ) > 0 ) { ...
1
vote
1answer
26 views

How to stop wordpress always displaying full-res images

Currently, my website is over 56mb just on the home page... I have 5 images, it's far too large and is killing the speed. Is there a way to make my site only display thumbnails or is this always ...
0
votes
0answers
23 views

Error 500 in loop to create posts and thumbnails

I'm using this loop to read a folder, and create a custom post with the basename info. But, around 20 images, the response is a error 500 and the process stops. I'm looking for some tip to do this ...
0
votes
0answers
38 views

When upload a PNG a noise appears in the thumbnails

Since we updated wordpress something strange has happened. We have a woocommerce where products have different color options for each part of this, and when you select a color, the image with that ...
0
votes
1answer
35 views

Overriding of the template for the Attachment “thumbnails” in the Media Grid isn't working

I'm trying to customize the template of the Media Browser (when clicking on "Add Media" button within Edit Post page), by adding a caption with the filename on each thumbnail so I don't need to select ...
0
votes
1answer
189 views

Force WordPress to strip/remove EXIF/IPTC metadata when resizing thumbnails

I am using Imagick with WP 5.0.3. Since version 4.5 WordPress use Imagick to create/resize thumbnails and it keeps EXIF/IPTC metadata (using GD, metadata are removed). WordPress keep EXIF/IPTC ...
6
votes
1answer
753 views

Is there a hook which fires after all thumbnails are generated?

I want to upload the image and all generated thumbnails to another server (as backup). I only found add_attachment, but this is fired right after the image was uploaded and the postmeta table was ...
0
votes
1answer
94 views

Show Post Thumbnail In Custom Post From Other CPT

I have a 'Match' CPT to create posts for each game played by a football team. These posts display details of the opposition team by pulling through information from the appropriate post from another ...
3
votes
1answer
54 views

How to create thumbnail of different files?

I am storing my uploads in a separate folder and using separate table to save the location in database. I have gone through WP_Image_Editor , wp_image_editor_gd and wp_image_editor_imagick . I also ...
0
votes
0answers
22 views

srcset for images does not work

I have a web store and I recently updated the theme of the site, when I see the images of the store were not displayed, inspecting in the browser console I realized that the image in "src" was correct,...
0
votes
0answers
20 views

How to view exact image dimensions of a media in Admin view?

I know programmatically we can see the attachment sizes in templates, but I'm looking for a way to see the precise dimensions of the resized medium, large, xlarge sizes too. No plugin seems to do this,...
0
votes
1answer
21 views

Thumbnails are hard cropped not matter what

I'm using WP Job Manager, and would like user-uploaded logos to be resized and positioned to fit within a fixed height and width. Currently, my settings are at: When I am uploading the following ...
1
vote
1answer
671 views

Wrong product thumbnail size

I have set the Thumbanil size to 112px, but the page is rendering the original size instead That is why the thumbanil is so pixelated The thumbnails show just fine in Firefox: What could be wrong? ...
1
vote
1answer
27 views

How check that there is post thumbnail feature image or not on wordpress?

On my wordpress site , I have some post that all of them have post thumbnail, but their post thumbnail removed from host and now when i want to load them on site , there is no image for loading to ...
1
vote
3answers
1k views

Image Quality Thumbnail Compression in Wordpress?

I’m lost I don’t know where to turn. I am trying to get my thumbnails to NOT be compressed at all. My uploads are nice and colorful, but the thumbnails gets very visibly duller and poorer quality. I ...
0
votes
0answers
55 views

Thumbnails regenerate wp_generate_attachment_metadata

I'm importin pictures via FTP and create custom recorss in mySQL via insert. I'm trying to make a cron job to regenerate thumbnails. This is what i came up to.. but i doesnt work. add_action( '...
0
votes
0answers
139 views

Can the WooCommerce image sizes be removed?

Is it safe to remove_image_size() on WooCommerce's built-in image sizes (woocommerce_thumbnail, woocommerce_single, woocommerce_gallery_thumbnail, shop_catalog, shop_single, shop_thumbnail)? I'd like ...
0
votes
0answers
2k views

Blank image thumbnails in media library

I copied one website to other domain. i am using avada theme in my new domain all images show as blank thumbnails in admin but in website all images are show i checked permission of all folder and ...
0
votes
1answer
24 views

Wp-query and column blocks

Maybe this is asking too much, but the new blocks give a simple way to add columns that work well responsively. ie you can just drop image thumbs into column blocks and they work perfectly on mobile ...
0
votes
0answers
16 views

Featured image size always cropped bottom

Good day! I am trying to add a featured image to my post but every time I add a featured image, the lower part gets cut off. Original size is 300x300 pixels. If the windows size gets changed, ...
1
vote
1answer
25 views

Media Gallery Upload Thumbnail Compression is Changing Image Hue

When I upload an image to my media gallery, all the image sizes that are generated are discolored. Here's an example. This is the full-size image: And now here is one of the smaller image sizes: ...

1 2 3 4 5 8