How to Display Shortcodes in Widgets

Home » Old posts » How to Display Shortcodes in Widgets


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

Nikola fivera 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.

Web Design Skills

I have been into web design for the last 10+ years.
After working for various agencies and companies I have decided to take a lone wolf path as a Freelancer but I still actively collaborate with agencies across the globe.
I enjoy building websites on WordPress platform but i can work on any other platforms as well.

SEO Skills

I have spent a last couple of years as an SEO executive and SEO consultant working on 4 continents.
Specialized in on-page SEO I wear a pointy Google-Wizard White-Hat and help various small and medium-sized businesses rank well in the search engines.
I enjoy working with Google and Yahoo SE.
Feel free to request a free meeting bellow.
As a freelancer, I charge only a small portion of the money you would pay to agencies to get your project done.
Nikola fivera Petrovic
Get in Touch

Leave a Reply

Be the First to Comment!

Notify of