Enable shortcodes in widget WordPress

0

By default, WordPress does not allow to add shortcodes in the widget. But we can enable shortcode functionality for Widget using WordPress Filter. So, Let’s see how to enable shortcodes in WordPress widget. it’s too easy to allow shortcode in a widget. just follow the below steps.

Enable shortcodes in widget WordPress

Open functions.php  of your current WordPress theme. Then add the below code at the end of the file.

add_filter("widget_text","do_shortcode");

Finally, You can use the shortcode on WordPress widget easily. Just past the shortcode code on the widget and check.  It’s doesn’t work with some custom widget please write a comment with widget/plugin name for help.

If you face any issue after adding this code then please write the comment. We are always ready for help.

Share.

Leave A Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.