Allow WordPress Widget to do Shortcode

Sometimes we use shortcode not only on the content of the article but also on some custom field, widgets, and more. By default, we’re not allowed to use it inside a sidebar or widget.

In this case, we need to add filter to make this happen. Simply add this to wordpress template’s function.php

add_filter('widget_text', 'do_shortcode');

It’s easy, fast and effective.

Now, you can do something like this:

allow shortcode widget in wordpress

 

*Some links may contain affiliate links. I may get small commission from your purchases to fund this website and to avoid annoying ads.