If you are using shortcodes in your WordPress site, you may want to make it so they will work in text widgets. This can be especially useful if you are using a plugin that produces a shortcode to call the plugin and want to display it in a sidebar or other widget area. Just add this WordPress Code Snippet to the functions.php file in your current WordPress theme in order to make it so your shortcodes will work when placed in a text widget.
/** * Allow shortcodes in Text Widgets * * @author WPSnacks.com * @link https://www.wpsnacks.com */ add_filter('widget_text', 'do_shortcode');
That’s it, now your shortcodes can be called inside text widgets and work correctly. Hope this helps, enjoy!
Leave a Reply