Shortcodes are great, and can be used for a variety of purposes within WordPress to cut out the hassle of adding code all over the place.
Even better, shortcodes allow you to edit things centrally and have them updated wherever they appear across your blog.
But, often, we find, our clients would like a feature in a sidebar, header, or footer widget which would be best driven by a shortcode.
WordPress doesn’t let you put shortcodes into widgets out of the box. But, with one simple modification, you can get this working on your WordPress website!
The fix is as follows:
- login to WordPress
- Under Appearence > Editor, visit the functions.php page of your current active theme
- Add the following code to the bottom of that file:
NOTE: This should be added before the closing ?>
Next, hit “Update” and then add a text widget with a shortcode in it to see how this performs.
Any problems, leave a comment below for us to solve publicly, and help out the community of people who also face the same issue!
If you can’t manage the above work, feel free to contact us about having Silicon Dales manage your WordPress website on your behalf.