How to use Shortcodes In WordPress Widgets

By default, WordPress does not allow the use of shortcodes in widgets. This is not a big problem as WordPress also makes it easy for you to enable this functionality. If you have the ability to do so, you will need to add a line to your functions.php file.

add_filter('widget_text', 'do_shortcode');

Or if you want to add shortcodes to the widget title

add_filter( 'widget_title', 'do_shortcode' );

Was this article helpful?
0 out of 0 found this helpful



Please sign in to leave a comment.