Installed a great plugin but want the widget it comes with in your content area?
Widgets are great but they generally can only be used in a widget area.
Unless of course you can simply create a shortcode for that widget.
Then you can insert the shortcode anywhere you like within your posts and pages.
You’ll find a list of 3 hook plugins near the end of this post about WordPress hooks which you can use to execute shortcodes in any hook location.
This is a plugin which makes it easy to create a shortcode for any plugin which uses widgets.
The plugin will create a new widget area where you can drag any widget into.
In this screenshot i have dragged the Jetpack blog subscriptions widget so i can display the subscription form within the content area of a posts.
To display a widget in all areas of posts or pages, you can install a hook plugin and execute the hook in any area there’s a hook depending on the theme you are using.
You’ll find a list of the shortcodes to use on the plugin page.
You’ll also need to find the i.d for the widget you want to use and insert it into the shortcode.
Finding Widget Name
To find the name of the widget and its i.d, simply right click the widget you have dragged into the shortcodes sidebar and click Inspect Element.
As you can see in this screenshot, the widget name and i.d are: widget-33_blog_subscription-2
Insert the shortcode with the widget name
Example: [do_widget id=blog_subscription-2]
You don’t insert the widget i.d just the name as shown above.
I tested this and it works fine.
Its also a great way to insert the Jetpack subscriptions widget into your posts.
Widgets on Pages
Tested this plugin as well and works. Simply follow the instructions on the plugin installation page and insert the short code.
Another plugin which also does this is the Custom Widget Areas for WordPress plugin. Its a premium plugin and does pretty much the same thing as the amr plugin.
It adds a small icon to your editor so all you need to do is click the icon and insert the shortcode anywhere you want to display the widget.