Divi: the easiest WordPress theme to use
Divi: The best WordPress theme of all time!
With over 901.000 downloads, Divi is the most popular WordPress theme in the world. It is complete, easy to use and comes with more than 62 free templates. [Recommended]
In the past, we showed you how to add and use widgets on WordPress. One of the most asked questions we get related to widgets is: how to use the shortcodes on these?
By default, shortcodes don't work on sidebar widgets.
In this tutorial, we will show you how to easily use shortcodes on the widgets of your WordPress blog.
Then let's get to work!
Why do shortcodes only work in widgets?
On WordPress, shortcodes provide an easier way add features in the text boxes like in the article editor when you write a.
Often newbies think that because there is a text widget then the shortcodes will work automatically. By default, any text defined in the text widget goes through WordPress filters which do not allow shortcodes to run.
Instead of seeing the end result, you'll see the shortcode itself as plain text. It's very easy to change that, and we'll show you how to easily enable running shortcodes on the WordPress text widget.
Also take the trouble to read How to easily add code to WordPress without breaking your website
Method 1: By adding a WordPress plugin
In this method, we will use a simple plugin. This method is recommended for beginners who do not want to add code manually.
The first thing you need to do is install and activate the WordPress Shortcode Widget plugin. For more details, check out our step by step guide on how to install a WordPress plugin.
After activation, you must visit the interface " Appearance> Widgets ". You will find a shortcode widget in the list of available widgets.
Just add the shortcode widget to a sidebar, then add your shortcode in the content area. Don't forget to click on the button Save to save the widget settings.
Easily create your website with Elementor
Elementor allows you to easily create any website design with a professional look. Stop paying expensive for what you can do yourself. [Free]
This shortcode widget is similar to the default text widget on WordPress. The only difference is that you can add shortcodes inside.
2 Method: Enabling the Running of Shortcodes in the Text Widget
If you are comfortable with codes then you can enable execution of shortcodes in the WordPress text widget.
Just add this code to your WordPress plugin.
// Activate shortcodes in a text widget add_filter ('widget_text', 'do_shortcode');
This code simply adds a new filter that lets you run the shortcodes inside the text widget.
How to add a widget at the bottom of articles on WordPress is to discover absolutely.
You can now visit the interface " Appearance> Widgets », And add a text widget to a sidebar. Paste the shortcode in the content area and click on the button Save.
Here is ! It is done. Visit your website to see how the shortcode runs.
Discover also some premium WordPress plugins
You can use other WordPress plugins to give a modern look and optimize the grip of your blog or website.
Are you looking for the best WordPress themes and plugins?
Download the best plugins and WordPress themes on Envato and easily create your website. Already more than 49.720.000 downloads. [EXCLUSIVE]
We offer you here some premium WordPress plugins that will help you do that.
1. Supreme Widgets
Supreme Widgets is a premium WordPress plugin designed to enhance your website with more than useful marketing and social features. He sets up pretty icons for Facebook, Twitter and other networks. Likewise you have a contact form with Captcha, and a responsive integration of Google Ads et Google Maps.
This plugin works perfectly with Visual Composer. If the latter is already installed, you can insert any widget into your page or article directly from its "Add an item" feature.
Flex-Register is a premium WordPress plugin that allows you to add a registration or login form in a lightbox. A refresh of the page will not be necessary and it will work immediately after installation. No configuration will therefore be necessary.
He will also take care of matching your form with the style of the WordPress theme active on your website.
As functionality, it offers among other things: a clean design and a well commented code, its fully customizable appearance, compatibility with the majority of popular WordPress themes, support for multiple browsers and others.
QuadMenu is a recently released WordPress menu plugin with a lot of useful features. Thanks to an interface that supports drag and drop, this WordPress plugin will offer the possibility for everyone to create drop-down menus on their WordPress website.
No coding skill is required because its menu builder has a fully visual interface accessible through your dashboard. You will also have the option to create an unlimited number of menus for your website, before assigning them to different areas of your website as well as to individual pages.
Read also our article on How to Add a CSS Code Safely to WordPress
This feature ensures that your menus and their content will be highly relevant to the content displayed, allowing you to display links that your visitors are more likely to click. New features should be added to QuadMenu soon. Its development team is also open to suggestions.
Easily create your Online Store
Download free WooCommerce, the best e-commerce plugins to sell your physical and digital products on WordPress. [Recommended]
Find out about other recommended resources to help you build and manage your website.
- How to translate your WordPress blog into several languages
- 10 WordPress plugins to create impressive sliders
- 10 WordPress plugins to create menus
- 10 WordPress plugins to protect your blog
Here ! That's it for this tutorial, I hope it will allow you to enable the execution of shortcode in the text widget of your WordPress blog. Do not hesitate to share with your friends on your favorite social networks.
If you have suggestions or remarks, leave them in our section Comments.