Running Shortcodes in Text Widgets

Awesome tip from Sarah Gooding over at http://wpmu.org – one of my favorite places to visit!

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:

add_filter( 'widget_text', 'shortcode_unautop');
add_filter( 'widget_text', 'do_shortcode');

For the original – Using Shortcodes in Text Widgets

Author: Eric Erickson

Share This Post On

Submit a Comment

Your email address will not be published.