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 Petrovic
Get in Touch

Nikola Petrovic

Hi there. My name is Nikola,
I speak English, Greek and Serbian.
As a Web Producer i can deal with almost anything web design & development related.
As a freelancer, I charge only a small portion of the money you would pay to agencies to create your website. Affordable web design doesn’t mean that it will lack any of the advanced features of today’s web technology. We just cut out the cost of the middle man.
Feel free to request a free quote using the form on the right or the one bellow.
Nikola Petrovic
Get in Touch