How to Use Shortcodes in WordPress Text Widgets

How to Use Shortcodes in WordPress Text Widgets

Quite awhile ago I shared a tip on using shortcodes outside of the post editor. Here’s another equally handy snippet for enabling shortcode use within WordPress text widgets.

Add this to your functions.php file:
{code type=php}
add_filter( ‘widget_text’, ‘shortcode_unautop’);
add_filter( ‘widget_text’, ‘do_shortcode’);
{/code}

Source: using shortcodes everywhere

Now you’ll be able to use shortcodes within text widgets, just as you would within the post editor. Follow Stephanie Leary’s tutorial to add shortcodes virtually anywhere you want within WordPress.