YAY-Fix for new Woocommerce Shop Archive
-
For those whose “click to view” in woocommerce shop archive page stopped working after new Woocommerce update, the “get post thumbnail” option was changed. So to fix, just add this into your child theme functions.php and the featured video plus will again work ??
//fix for shop archive featured image get post thumb remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10); add_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10); if ( ! function_exists( 'woocommerce_template_loop_product_thumbnail' ) ) { function woocommerce_template_loop_product_thumbnail() { echo woocommerce_get_product_thumbnail(); } } if ( ! function_exists( 'woocommerce_get_product_thumbnail' ) ) { function woocommerce_get_product_thumbnail( $size = 'shop_catalog', $placeholder_width = 0, $placeholder_height = 0 ) { global $post, $woocommerce; $output = '<div class="imagewrapper">'; if ( has_post_thumbnail() ) { $output .= get_the_post_thumbnail( $post->ID, $size ); } $output .= '</div>'; return $output; } }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘YAY-Fix for new Woocommerce Shop Archive’ is closed to new replies.