• Hi,

    So I need to display a widget through a shortcode on Wooocommerce’s single product page by adding it through functions.php. Here’s what I’ve tried but it’s not working:

    add_filter( 'woocommerce_short_description', 'custom_woocommerce_short_description' );
    
    function custom_woocommerce_short_description( $description ) {
    global $post;
    
    $description = $description . do_shortcode('[widget id="mks_author_widget-3"]') ;
    
    return $description;
    }

    What could be the issue?

    Thanks

    • This topic was modified 7 years, 10 months ago by paxton111.
    • This topic was modified 7 years, 10 months ago by paxton111.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Not working when added through functions.php’ is closed to new replies.