Add Filter Code to Theme Functions
Step 1. You need to add one line of code to your functions.php. You can also install a plugin, like Code Snippets, to add the line of code as a Snippet. Add this line of code (and the comment) at the end of your child theme’s functions.php and save. If you use Code Snippets, be sure to activate the code snippet after saving.
/* Allow shortcodes in widget areas */ add_filter('widget_text', 'do_shortcode');
Step 2. Next find the widget area you want to use. In your WordPress Dashboard, go to Appearance > Widgets.
Step 3. Add a Text Widget to your widget area, maybe your Sidebar. Yes, you’re going to add the shortcode to a Text Widget.
Step 4. Then add the shortcode and save.
Let’s look at some examples.
Add a Slider to a Sidebar
Soliloquy Lite is a beautiful and easy to use slider. Once you create the slider, over on the right side, there will be a shortcode for you to use. The slider shortcode looks like this:
Copy and paste this code into your Text Widget, save, and you will have a slider in your sidebar.
No comments:
Post a Comment