admin管理员组

文章数量:1333394

I have updated the large image size to be 1440px by 1440px on Wordpress, however it only pulls 2048 for the 2x. I have created a 2x size of 2880x2880 and have also updated 2048 to be 2880x2880 however when I do it no longer shows the retina size.

Things I have checked so far: the image is being generated by Wordpress upon upload. I have taken the new large image limit put in place since 5.3 out using the specified filter. I have no lazyload plugins or other plugins that manipulate images apart from the plugin 'regenerate images'

this is all within the standard image block in Wordpress and Gutenberg

I'm at a loss at what else to do.

   // Image threshold removal
   add_filter( 'big_image_size_threshold', '__return_false' );


   /// UPDATE IMAGE SIZES

   //LARGE
   update_option( 'large_size_w', 1440 );
   update_option( 'large_size_h', 1440 );

   //MEDIUM LARGE
   update_option( 'medium_large_size_w', 1350 );
   update_option( 'medium_large_size_h', 1350 );

   //MEDIUM
   update_option('medium_size_w', 675);
   update_option('medium_size_h', 675);

   //THUMBNAIL
   update_option('thumbnail_size_w', 320);
   update_option('thumbnail_size_h', 320);

   //2048x2048 
   add_image_size( '2048x2048', 2880, 2880); 

I have updated the large image size to be 1440px by 1440px on Wordpress, however it only pulls 2048 for the 2x. I have created a 2x size of 2880x2880 and have also updated 2048 to be 2880x2880 however when I do it no longer shows the retina size.

Things I have checked so far: the image is being generated by Wordpress upon upload. I have taken the new large image limit put in place since 5.3 out using the specified filter. I have no lazyload plugins or other plugins that manipulate images apart from the plugin 'regenerate images'

this is all within the standard image block in Wordpress and Gutenberg

I'm at a loss at what else to do.

   // Image threshold removal
   add_filter( 'big_image_size_threshold', '__return_false' );


   /// UPDATE IMAGE SIZES

   //LARGE
   update_option( 'large_size_w', 1440 );
   update_option( 'large_size_h', 1440 );

   //MEDIUM LARGE
   update_option( 'medium_large_size_w', 1350 );
   update_option( 'medium_large_size_h', 1350 );

   //MEDIUM
   update_option('medium_size_w', 675);
   update_option('medium_size_h', 675);

   //THUMBNAIL
   update_option('thumbnail_size_w', 320);
   update_option('thumbnail_size_h', 320);

   //2048x2048 
   add_image_size( '2048x2048', 2880, 2880); 

Share Improve this question edited Jun 19, 2020 at 14:50 Matthew t Down asked Jun 19, 2020 at 13:09 Matthew t DownMatthew t Down 11 bronze badge 3
  • It would help if you can share the code you are using, for example to create the 2880 size, "update 2048 to be 2880," and take the large image limit out. – WebElaine Commented Jun 19, 2020 at 13:40
  • @WebElaine sorry about that. I have added the code I use to update and remove the large image limit – Matthew t Down Commented Jun 19, 2020 at 14:51
  • You could try changing the "2048x2048" size name to something in text - i.e. "retina" - to test whether that gives you the full size you're looking for. I'm thinking the size may be cueing WP to crop based on the name rather than the other params. – WebElaine Commented Jun 19, 2020 at 16:48
Add a comment  | 

1 Answer 1

Reset to default 0

Three things to check:

  1. Have you added add_theme_support('post-thumbnails');?

  2. Is the uploaded image larger than 2880px x 2880px?

  3. Are you already regenerate all the thumbnails, including the existing?.

Referring to the second, if the image is not "suitable" for the size, WordPress won't make the thumbnail, because it can't. For instance, if you upload an image, let's say 1200x600, and you have a thumbnail size that creates an image for 1600px of width, WordPress won't create that thumbnail.

本文标签: functionslarge image size of 1440x1440 not pulling 2x of 2880x2880 image