/** * Display a video instead of the single product image */ // Removes the product image and thumbnails and adds an embed link to a YouTube video. // Only applies to one product as specified by product ID. // https://www.businessbloomer.com/woocommerce-show-video-instead-featured-image/ add_action( 'woocommerce_before_single_product', 'cc_show_video_not_image' ); function cc_show_video_not_image() { // Do this for product ID = 282 only if (is_single('282')) { remove_action('woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20); remove_action('woocommerce_product_thumbnails', 'woocommerce_show_product_thumbnails', 20); add_action('woocommerce_before_single_product_summary', 'cc_show_product_video', 20); } } function cc_show_product_video() { echo '