Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [image-size]

WordPress has four built-in image sizes. Uploaded images will automatically be scaled to all these sizes. It is possible to remove these defaults and to add custom image sizes.

1
vote
0answers
22 views

Not all featured image sizes available in Rest API

I'm using Vue.js to consume the Rest API for both posts and a custom post type. I'm using the _embed query on the URL for the endpoint to get sizes for the each featured image. The issue that I'm ...
0
votes
0answers
9 views

How can I hook to the thumbnail creation function and create an additional image in other folder?

I need to create the "retina" image with 2x width of each existing image in the folder "uploads" to the folder uploads/scaled. like this: image_resize( string $file, int $max_w, int $max_h, bool $...
0
votes
0answers
13 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, ...
0
votes
1answer
10 views

(Divi): How to make Wordpress load images of specific size for Blurb modules on given page with a funciton?

I have 28 pictures uploaded to media library, each around 3mb. Wordpress has already created resized copies of those: thumbnails, medium and large. The pictures are used as Divi's Blurb module images ...
0
votes
1answer
28 views

Clear out old images, any advice?

I'm working on a site which has a media library that is now 7GB - and I really want to clear out all the unused images. I've tried using the Media Cleaner Plugin: https://wordpress.org/plugins/media-...
-1
votes
0answers
27 views

Use functions.php to display image attachment pages at full size

I'm using Elementor in a site featuring a lot of images which I'd like to display individually using a custom attachment page, which can be generated automatically using Elementor's Page Builder ...
0
votes
2answers
78 views

Woocommerce image sizes missing from Appearance › Customize but not declared by theme

I would like to resize the 100px x 100px store thumbnail images. The sizes are supposed to be set under Appearance › Customize › WooCommerce › Product Images These size settings are missing. After ...
0
votes
0answers
40 views

Images uploaded via Gutenberg image block are cropped

I'm trying to add images to a post with the following work flow using the Gutenberg editor on version 5.1. Add an image block -> select upload -> select image. The image is uploaded to the page and ...
1
vote
0answers
13 views

Sharing images to social media - issue with aspect ratio

I am designing a website that will have a lot of images, and I want those images to be shareable to Facebook. I know this is possible with social media plugins like "Easy Social Share Buttons," where ...
0
votes
1answer
20 views

How to make image uploads default to full size?

I want to make it so that when an image is added to a post, full size is selected by default. It currently defaults to large. I have tried: function my_set_default_image_size () { return '...
0
votes
1answer
43 views

Correct method of reducing the number of images created by WP and Woo together

I create my own WP&Woo theme and i have some doubts about the number of images that are generated by wordpress plus woocommerce Wordpress generate 4 sizes Woocommerce generate another 3 sizes So ...
0
votes
1answer
207 views

How to properly set custom logo size?

According to the Codex page about adding a Custom Logo, one has to add the following code to functions.php: function themename_custom_logo_setup() { $defaults = array( 'height' => ...
0
votes
0answers
15 views

Soft proportional crop short side

Is it possible to soft crop an image with custom-size along the short side of the image? Right now my images are used as background of a div with background-size: cover; after they are soft-cropped ...
0
votes
1answer
412 views

How use custom image size + ACF + background image

How to get the URL from an image with custom image size to use as a background-image from AFC? Register size in functions.php: add_theme_support( 'post-thumbnails' ); add_image_size( 'homepage-thumb'...
0
votes
1answer
49 views

File upload size limit in wordpress and php.ini limit

I am developing a wordpress site, I have hosted my wordpress site on Infinityfree.com as of now. I am trying to upload a plugin which is 18MB and landing with this error "The uploaded file ...
0
votes
0answers
83 views

Woocommerce shows product images in the wrong size

All products in my website have 200x200 featured images. But in catalog images are shown in 750x750 (sooo blurry) instead of 200x200. Source code of catalog page: <img width="200" height="200" src=...
0
votes
0answers
21 views

Missing image size

I have added a couple of custom sizes to my wordpress environment with the following code: add_image_size( "maximal", "1900" ); add_image_size( "desktop", "1400" ); add_image_size( "tablet", "900" ); ...
5
votes
0answers
261 views

Edit srcset and sizes attributes in Gutenberg image, cover and gallery - blocks

I am looking for a way to adress the responsive srcset and sizes attributes on Gutenberg image blocks - like image, cover and gallery. Usually one would do this with the '...
1
vote
1answer
36 views

IMG src weird behaviour inside a single post loop

I was trying to sort out the final look the featured image of a single post, so for the purpose wanted to add a class to the img tag. However on the way, I run into some weird behaviour while trying ...
1
vote
1answer
296 views

wordpress responsive image srcset not working

I'm trying use wordpress core responsive image feature but it's not adding srcset to image. Here is th my codes I have a div w=370px h=280px now I added image sizes if(function_exists('...
0
votes
0answers
83 views

Customize Sizes Attribute for Default Image Sizes (Medium, Large)

I'm trying to modify the default 'sizes' attribute for images placed in content using the default WP sizes (e.g., Medium or Large). These are images generally placed in the body of a page/post with ...
0
votes
0answers
10 views

Can I edit mogrify command arguments in WordPress if it uses ImageMagick during upload of images?

Reading through https://www.smashingmagazine.com/2015/06/efficient-image-resizing-with-imagemagick/ and https://wordpress.org/plugins/ricg-responsive-images/ from my understanding, it seems that ...
0
votes
0answers
13 views

Stripes in a top Banner

While playing with different resolutions I found that I get stripes on the top banner of the website (wordpress). I looked at the CSS and it is pretty straight forward: .banner-top {position: ...
3
votes
1answer
285 views

Force all images to full size in page template

I have a page template that outputs all posts with minimal formatting - no headers, footers, sidebars, etc. With the loop, the_content() is used to output content (text and images). I need to ...
0
votes
1answer
113 views

Get a specific size from wp_get_attachment_image_src

I have this section in my website where i use wp_get_attachment_image_src() to get all the images associated with the post, but now you want to get a certain size (size: listing_grid): <?php $...
0
votes
0answers
117 views

Get srcset and size atribute from Rest API

Is there a way to get the srcset and sizes atribute for a feature image from the posts endpoint in the WP REST API? Or do I need to generate them with JS from _embedded['wp:featuredmedia'][0]....
0
votes
0answers
31 views

Specifying image size used in template the_content

I have a template that is used to display all posts. It uses query_posts with a set of $args that I specify. The template uses the_content to output the content of each post (text and images) I want ...
1
vote
0answers
224 views

ACF Wysiwyg Editor Image srcset for responsive images [closed]

I cannot find a way to generate srcset for images added inside Wysiwyg Editor field of Advanced Custom Field (ACF) plugin. Obviously, i know how to generate WordPress image srcset using: ...
0
votes
2answers
74 views

Post thumbnail not displaying correct size

I created a custom template. It contains 3 columns, and the middle column should only display the post thumbnail. But no matter what size attribute I'm setting, it's not changing the size the way I ...
2
votes
1answer
220 views

Unexpected width and srcset attributes for the_post_thumbnail();

I am modifying a theme, using a child theme, and in a template file (single.php) I need to display a large post thumbnail, so I have this code: the_post_thumbnail('large'); In Settings > Media, the ...
0
votes
1answer
21 views

How to add the option to choose between sizes for featured image within post editor?

Drew a blank Googling for this... Our website homepage shows a grid of featured image thumbnails on the home page. Some of these images are portrait and some are landscape. I would like to be able ...
0
votes
1answer
38 views

How to compress thumbnails instead of cropping

I have a console script which imports woocommerce products and creates images and its thumbnails for products. The problem is that thumbnails are cropped. And I need to compress all generated ...
3
votes
0answers
100 views

Using srcsets to load different images based on browser widths

I want it so that on a mobile breakpoint, the image in my function uses 'full' and on laptop/desktop it uses 'thumbnail'. Here's a snippet of what I've got going on: while ($sponsors->have_posts()...
2
votes
1answer
905 views

How to get CMB2 to show a single image at a specific size

Trying to get the CMB2 plugin to display an image at the WP default medium size on the page. I can get it to display an image but that image could be any size the user wants I'd rather it was cropped ...
1
vote
0answers
25 views

Control Responsive Images

I noticed on my site that the images I'm using are presented in html as having variants, this is causing some images to look terrible on smaller screen mobile phones. I extracted the html: https://...
0
votes
1answer
44 views

Custom image sizes quality

Images uploaded on my WordPress website are too heavily compressed. I found out that WordPress automatically compresses images and you can change that with a filter: add_filter( 'jpeg_quality', ...
1
vote
1answer
1k views

How to change Thumbnail size of next Gen Gallery plugin?

I recently installed nextgen gallery plugin . and I show my gallery with BASIC COMPACT ALBUM, but image thumb size is too small. and I want set thumbnail 300x240. I set image size with CSS but images ...
2
votes
1answer
65 views

Passing srcset to image attachment method

I would like to pass values of wp_get_attachment_image_srcset to the wp_get_attachment_image method and wonder how is this possible without hardcoding the HTML image tag itself?
0
votes
1answer
105 views

Creating black and white copy of an image [closed]

I want to duplicate a image and convert it to BW with a new name but I get this warning when I try to save it with imagejpeg(): PHP Warning: imagejpeg(/srv/www/raquelfriera.test/current/web/app/...
1
vote
2answers
51 views

show first 3 thumbnails of posts in different sizes [closed]

i want to make a little Header with the 3 recent thumbnails in different sizes and start my loop with the 4th recent posts, can someone give me a function for that please? please no widgets i want to ...
0
votes
1answer
79 views

Post thumbnail throwing size limit parameters in <img>

<ul class="widget_image_2"> <?php while ( $query->have_posts() ) : $query->the_post(); ?> <li> <?php the_post_thumbnail( 'medium'); ?> <a href="<?php ...
0
votes
2answers
20 views

New portfolio items appearing smaller on the grid

For some reason that I cannot understand the new items that I'm adding to my portfolio are appearing smaller in the portfolio grid. I'm relatively new to this, so I'm completely lost. If it were ...
1
vote
0answers
33 views

Scaling images for mobile

I'm feeding a mobile app from WP. I want the images uploaded to be rescaled like x0.5, x0.3 . add-image-size doesn't give me scaling functionality, only resizing by pixel. Any Idea? thx.
0
votes
2answers
2k views

How to exclude an image size from the Wordpress srcset

Wordpress srcset is a great feature but there are occasions when it's important to control exactly which image sizes are included in the srcset code. For example, on one of our sites we generate a ...
0
votes
2answers
323 views

Make medium_large images available to insert into post

Our post have a Max width of 768, so using the medium_large images is the preferred size for our authors. I ssumed since medium_large isnpart of core, this would be included but I don't see an easy ...
1
vote
1answer
15 views

Remove Size images without use

If possible know that size image are not used in my theme? Example: If use a theme that have 10 size. But I think that I don´t use all images size. Is possible know that size I don´t use? Sorry for ...
0
votes
2answers
28 views

Wordpress can't detect any thumbnails size?

Wordpress can't detect any thumbnails size, I re-generated all image but not work. The plugin (Simple Image Sizes) can detected all thumbnails size settings. But when I want to use, it can't detect ...
0
votes
1answer
33 views

How to resize image in wordpress from backend? Seems like bug in wordpress

I'm trying to resize images to smaller sizes using wordpress admin. But I have trouble doing it. I have selected an image and opened it for editing. Original dimensions of my image is 255 × 300. ...
0
votes
2answers
927 views

How to change the catalog product image size by product id?

I am wondering if I could change the size of one specific catalog product image. I have many products with the same size (catalog images-not single product images, not even product thumbnails) and I ...
1
vote
1answer
520 views

If I Regenerate Thumbnails, would WordPress delete the existing Thumbnails and replace them with 'new copies'?

I am currently working on a website, which has 1,000's of Product Images. All of these images were uploaded, without being optimized accordingly. For instance, most of the Product Images were ...