Widgets make it easy for users to simply drag and drop items into their WordPress site. Even though you can extend the power of default WordPress widgets, they are still limited to widget ready areas in your theme such as sidebars and footers. Wouldn’t it be nice if you could add widgets in your post or page content without writing a single line of code? Well, in this article, we will show you How to Add WordPress Widgets in Post and Page Content.
Add WordPress Widgets in Post and Page Content
First of all install and activate WordPress plugin i.e amr shortcode any widget. Once you activate the plugin, go to Appearance » Widgets. Next, drag and drop the widgets you want to display in your post or page into the Shortcodes sidebar.
Now those widgets are ready to be added to your content. Go to the post or page edit screen, and paste the following shortcode wherever you like in your content: [do_widget widgetname].
If the widget name has space in it, then you need to add widget name in quotes like this:
[do_widget "recent posts"]
That’s it. Now you can add WordPress widgets in your post and page content. If you want to add a little more style to your widgets, then you might want to check out our article on how to make WordPress widgets colorful and less boring. Most widgets have titles, but if you don’t want to display them, then use this tutorial on how to hide widget titles.
If the widget does not show up in your content, then you need to use the widget id in the shortcode. First, make sure that you have added the right widget in the shortcodes sidebar, and you have added the shortcode with the widget name in your post or page. Publish that post/page and open it in a new browser window. Add the following string at the end of the page URL like this:
It will show you debug information with widget IDs. Look for widget ids under the Shortcodes Sidebar.