Enable Shortcode in Wordpress Widgets

Writing shorcode in widget does not show anything? By default the widgets does not have the support for the shortcodes or php. You have to manually enable the support for the shortcodes in widget area under text widgets. Some theme might have the support for shortcodes in widget area.

To enable shortcode in widgets just copy the following code snippet in your function.php file.

// Enable shortcodes in widgets
add_filter('widget_text', 'do_shortcode');
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s