We need to add shortcode into the WooCommerce Product Description. The intent is that we can call blocks into specific products and just update that block vs. the each individual listing. Any idea how to do so? Currently it just shows the actual shortcode, not the content.
This is the shortcode: [block id="product-callouts-01"]
I tried this code in my Functions.php file, but to no avail:
if (!function_exists('woocommerce_template_single_excerpt')) {
function woocommerce_template_single_excerpt( $post ) {
global $post;
if ($post->post_excerpt) echo '<div itemprop="description">' . do_shortcode(wpautop(wptexturize($post->post_excerpt))) . '</div>';
}
}
2
Answers
Try This code to your function.php
To add a shortcode to the product description, you can try the following:
Code goes in functions.php file of your child theme (or in a plugin). It should work.