In this very short tutorial I’m going to share a little snippet to enable shortcodes in WordPress widgets. By default, all shortcodes can only be used in post and page post types.
To add shortcode support in widgets, simply paste the following code in functions.php file of your child theme:
1 2 3 4 |
|
Here’s the result after you’ve added the code:
In this example, I’m using ET Shortcodes plugin by Elegent Themes. Simply adding this shortcode to your text widget will not get the same result.
Want something more? Stephanie Leary has a very comprehensive article on enabling the shortcode on everywhere else.
Vikram Pandit says
Hey thanks for the info….I may have to use it at some stage!
everest9 says
short but wonderful tutorial but how can i enable this to genesis themes
Rudd says
Same. Just put the code in the functions.php file of your child theme.
Juan says
Thanks, this helped me.
Areesha Noor says
Hi admin,
It’s so easy method,
I never heard about this type of tutorial. it is very simple tricks.
thanks admin for sharing with us.
Areesha Noor!