• paxton111

    (@paxton111)


    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 9 years ago by paxton111.
    • This topic was modified 9 years ago by paxton111.
Viewing 1 replies (of 1 total)
  • Plugin Author shazdeh

    (@shazdeh)

    Hi,

    Wondering, does the shortcode work if you add it to a page’s contents?

Viewing 1 replies (of 1 total)

The topic ‘Not working when added through functions.php’ is closed to new replies.