Display Shortcodes in Widgets – WordPress snippet

Many of us use plugins that are displayed trough shortcodes.

You know what shortcodes are,  don’t you?

They are keywords in

[square brackets] that do something special, return a string or call a plugin.

When we need to display  shortcodes in widgets though, they simply don’t work.

Well … here is the simple snippet to make them work !

in you functions.php just drop this piece of code.

<?php add_filter('widget_text', 'do_shortcode') ?>

 That’s how you display Shortcodes in widgets.


Nikola fivera Petrovic
Get in Touch