David
  • 0

How to change woocommerce shop or product archive page default images?

  • 0

I have a size of 324*243 which rendered in product archive and shop page.In bigger screens the images appeared as blurred.How can i fix that?

1 Answer

  1. To fix that,You should call a larger resolution images than the existing one.  Let’s set a size of 513*385 in both pages,which will look good.These are the following steps:

    1. Regenerate a custom size (513*385 in my case) using Regenerate Thumbnails plugin https://wordpress.org/plugins/regenerate-thumbnails/ or it can achive by WP-CLI as well.(https://developer.wordpress.org/cli/commands/media/regenerate/)
    2. Set a custom size of image in WP-admin Settings > Media Add an image size https://imgur.com/a/UV3g868
    3. Go to Regenerate thumbnails settings and click Regenerate for all * images
    4. Added the following code in functions.php of my child theme.
    5. // Define the new thumbnail image size
      add_image_size( 'woocommerce_thumbnail', 513, 385, true );
      
      // Update the WooCommerce thumbnail image size settings
      add_filter( 'woocommerce_get_image_size_thumbnail', function( $size ) {
      $size['width'] = 513;
      $size['height'] = 385;
      $size['crop'] = true;
      return $size;
      } );
      

Leave an answer

You must login to add an answer.