We all know about the widgets in WordPress. Generally we use widgets always in sidebar or any other widgetized area.
Sometimes the question arises, is that the only way to use a widget, is that possible to use those widgets outside the sidebar?
YES, with Widget Shortcode plugin it is possible to using widget outside the sidebar.
This plugin adds a shortcode with any widget which enables you to output widget anywhere you like.
[notification type=”alert-info” close=”false” ]You may also like our article Create Custom Widget Area in WordPress
[/notification]
Let’s find widget shortcode to use it outside the sidebar
To display a widget you need to find widget shortcode. To create a shortcode you need to find a widget id.
[widget id="text-1"]
The above code will output a text widget but the question is, where you can find the widget id? This plugin will output the widget id below the widget you add in a new widget area called ‘Arbitrary’.
When you activate the widget a new widget area named ‘Arbitrary’ is created. It adds and display a shortcode to any widget added in the ‘Arbitrary’ widget area.
- Install & activate the plugin Widget Shortcode .
- After successfully activation of this plugin you need to go Appearance -> widgets. Here you can see a new widget area named ‘Arbitrary’. This is the place where you can get shortcode for any widget.
3. Add any widget in Arbitrary section and click on Save. Now you will get a shortcode for that widget. Copy that shortcode.
4. Paste the shortcode to any page or post.
You can add multiple widget to get it’s shortcode and place it anywhere in your WordPress theme.
You can further style your widget by adding some CSS code to your theme.
All done, in this way you can show any widget to anywhere you want in your WordPress theme.
Thanks for your time sharing this simple fix who had this kind of problem. 🙂
Your widget is a great idea and it helped me solve a major issue in my blog. Thank you!!!