How to Add Shortcodes in Text Widgets WordPress
ON: April 27, 2011
Comments: 0
Recently we were working on a project and our client needed the ability to add WordPress shortcodes in their sidebar through the use of Text Widgets. Shortcodes have the brackets around them and resemble this [shortcode] A number of WordPress themes, plugins, and premium Wordrpess themes come with built in shortcodes.  Shortcodes are great for adding robust functionality to your website easily and quickly.  But how do you do it?  It is actually very easy and only takes about two minutes of your time. To enable shortcodes in your WordPress text widgets, all you have to do is sign into your WordPress dashboard.  Once you have signed in to your WordPress install, simply navigate to Appearance –> Editor –> and find your functions.php file.  Most likely the file will be labeled Theme Functions. Once you find the functions.php file, go to the bottom of the file and add the following code before the ?> // Add the Shortcodes in text widgets add_filter('widget_text', 'do_shortcode'); That is all there is to it!  Hope it works out, if you have any questions feel free to leave a comment.



No comments yet