Tag Archives: WP Widget

Allowing Shortcode in sidebar widget

By default, WordPress won’t allow you to add shortcode in sidebar widget. There are several plugins that requires shortcode to be added to post, or do the hard-coding jobs to do them manually on template. And its frustrating when you have a dynamic sidebar and you want a widget that runs on shortcode.

So, a line of code added to functions.php of your theme can make a difference and you can just add shortcode like in posts.


add_filter('widget_text', 'do_shortcode');

to functions.php file of the theme and after then its all possible.

Happy Widgetizing!!