Answers for "add shortcode in short description"

CSS
1

add shortcode in short description

<?php echo do_shortcode("[shortcode]"); ?>
Posted by: Guest on March-24-2021
0

add shortcode in short description

remove_action( 'woocommerce_after_shop_loop_item', 'sp_loop_product_description', 6 );
add_action( 'woocommerce_after_shop_loop_item', 'wp_11326339_custom_description', 6 );

function wp_11326339_custom_description() {
    global $product;

    $wc_product = wc_get_product( $product );

    if ( ! $wc_product ) {
        return false;
    }

$short_description = $wc_product->get_short_description();

    if ( '' !== $short_description ) {
        echo '<div itemprop="description">' . do_shortcode( wpautop( wptexturize( $short_description ) ) ) . '</div>';
    }    
}
Posted by: Guest on March-24-2021

Code answers related to "add shortcode in short description"

Browse Popular Code Answers by Language