WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
[resolved] Filters to product images and thumbnails not work (3 posts)

  1. prolab
    Member
    Posted 1 year ago #

    I added a filter "woocommerce_single_product_image_thumbnail_html" to change the image size of the product, but it does not work, and the filter "post_thumbnail_size" works, but that's not what I need. Here is my code:

    add_filter( 'woocommerce_single_product_image_thumbnail_html', 'motomir68_image_prod_large', 1 );//not work
    
    add_filter( 'post_thumbnail_size', 'motomir68_image_prod_large', 1 );//work
    
    function motomir68_image_prod_large(){
    	return 'large';
    }

    How can I get the filter "woocommerce_single_product_image_thumbnail_html"?

    http://wordpress.org/extend/plugins/woocommerce/

  2. Roy Ho
    Member
    Posted 1 year ago #

    You're not using the correct filter. The one you tried to use is for outputting HTML which includes the anchor tag and everything. What you want is this filter:

    single_product_large_thumbnail_size
  3. prolab
    Member
    Posted 1 year ago #

    Thank you! My mistake.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic