• swpshadley

    (@swpshadley)


    Hello,

    We want to show larger product image sizes (when you click into the product itself) for all products in a certain category. I tried the following function…

    add_action( 'init', 'yourtheme_woocommerce_image_dimensions', 1 );
    
    /**
     * Define image sizes
     */
    function yourtheme_woocommerce_image_dimensions() {
    
         if (is_product_category('wood-deals')) {
    
    	$single = array(
    		'width' 	=> '200',	// px
    		'height'	=> '200',	// px
    		'crop'		=> 1 		// true
    	);
         }
    
    	// Image sizes
    
    	update_option( 'shop_single_image_size', $single ); 		// Single product image
    }

    Got the code here – https://premium.wpmudev.org/forums/topic/how-can-i-custome-and-fix-woocommerce-product-image-size

    This didn’t work. Anyone know how to do this? Thanks in advance.

  • The topic ‘Change Woocommerce Product Image Size – category dependent’ is closed to new replies.