How to enable Shortcodes in WordPress text widget

Here’s another useful code snippet I found on WordPress support forums. Its a quick trick which allow you to use Shortcodes in WordPress text widgets.
To enable shortcodes in text widget, add following code into your functions.php file

//Enable Shortcodes in WordPress text widget
add_filter('widget_text', 'do_shortcode');

Now, you can use shortcodes in widgets as you do in post editor.

Useful Read: Exclude or hide categories from category widget in WordPress sidebar

0 Comments

Leave a Comment.