If your WordPress theme’s widget sidebars aren’t in the right places and you don’t want to edit the theme files, there’s an easy solution. You can embed a sidebar within your pages or posts.
There’s a feature in the Content Aware Sidebars plugin that lets you create a new sidebar or widget area and insert it anywhere using a shortcode.
So, What’s a Sidebar?
Just to back up a bit, a sidebar is any area in your theme’s layout where you can show widgets, so sometimes people will refer to them as widget areas. Sidebars can appear anywhere in a theme including the footer, so despite the name, they’re not limited to appearing in side columns. To see all the available sidebars in your theme, go to Appearance > Widgets in your site dashboard.
Creating a Your New Sidebar
Now, after activating Content Aware Sidebars, you’ll have the Sidebars menu item in your admin dashboard menu.
Just create and configure the new sidebar to appear on the Pages or Posts that you prefer and then, under the Options panel on the right, change the Action to Shortcode.
Now you’ll see a shortcode with the ID for this particular sidebar like ca-sidebar id="1368"
. Copy it and then save the sidebar.
Next, go to Appearance > Widgets and you’ll see the new Sidebar. Drag your widgets as usual to it. They will only appear on the pages that you designated.
Inserting the Sidebar into Your Pages or Posts
Now go to your page, switch to the HTML tab, and paste in the shortcode anywhere in the page. This could be in a custom section or within column shortcodes. Note: You might have to select a different page template like a full-width layout to remove any existing sidebars to get your desired look.
This method won’t work to add content outside of the main content loop. For example you won’t be able to add sidebars in your header or footer using a shortcode. For that you’ll have to insert the <?php ca_display_sidebar(); ?>
code into your theme. More on this is in the plugin’s FAQ.
Hope this helps!
Priscilla Chapman
WordPress Developer, Web Support
Priscilla Chapman is a web developer specializing in WordPress working from Gainesville, Florida.