Shortcodes in Widgets


Widget Background

By default, WordPress does not allow shortcodes to be used in widgets. Attempting to use a shortcode in any widget area will result with just the shortcode text being displayed on the front end of the website.

There is a very simple function which can be included from a child theme that allows shortcodes to be used in widgets.

add_filter('widget_text', 'do_shortcode');

The WP Edit Pro Way

WP Edit Pro makes this even easier by including an option in the admin panel. Simply check the option; and you’ll have shortcode usage throughout all of your widget areas.

To allow shortcodes in widgets; go to the WP Edit Pro admin settings page -> General tab.

short_opt


Josh Lobe has written 53 articles

Josh Lobe is the sole developer of WP Edit and WP Edit Pro. A father of two; a husband to a beautiful wife; and a small home in the suburbs... he primarily enjoys coding in WordPress and designing websites.

Leave a Reply

Your email address will not be published. Required fields are marked *

ENTER CAPTCHA MATH *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>