Sometimes when building your site you’ll want to have a completely different sidebar on some pages or posts to the standard one you use throughout the rest of your site.
If the tweak to the sidebar is minor, you can use a plugin like Widget Logic. But when a completely different sidebar is required, I use Content Aware Sidebars. It’s a free plugin that you can find on the WordPress Repository.
In the video I refer to the Widget Logic plugin and also to a page on the WordPress.Org site where you can get all the information you need to control the Widget Logic plugin. That page is the Conditional Tags page and is well worth studying.
Content Aware Sidebars
You can find this plugin in the WordPress repository here.
Slider Used In This Demo
The sliders shown in this video were built using the Genesis Club Pro plugin.
Hi this is Liz here and I am going to talk today about content aware sidebars and how to manipulate your sidebar using WordPress so that you have a sidebar that you want on each part of your site. Sometimes you are just not going to want to see the same sidebar.
Let’s have a look at a couple of examples, I am just going to use my personal blog, such as it is and that is at elizabethjamieson.com.
My Existing Sidebar
And, basically if I go to one of my posts, which is here for example. If I scroll down you’ll see that I’ve got a sidebar here with stuff in it and wherever you go on my site that’s what the sidebar will look like. And, that’s dictated to by the widgets in this primary sidebar area.
So I’ve dragged certain widgets into the primary sidebar and that’s resulted in my sidebar looking like this.
But, supposing for one particular page on my site I didn’t want this sidebar I wanted a slightly different sidebar.
Small Changes To WordPress Sidebars
Let’s say I wanted to put a tiny little slider in here just above the affiliate disclaimer, but I only wanted that tiny little slider to appear on one page, and for the purposes of this demo I’ve made another page called Another Page, and I am going to pretend that I only want the slider to appear here on this page, but on every other page the sidebar will be exactly the same.
Well that is really easy to do you just need to install a widget control plugin. Now, I always use Widget Logic, I like it a lot; it’s very simple. So if I just go to this post and I just go up to the top where it says edit and I hover over edit I can see, if you look down at the bottom, that this is post 375.
Find Post ID Of Post Or Page
Fine, great. If I go to Another Page, the one that I want my little slider to appear in on the sidebar and I do the same thing and I hover over the edit we can see that this is post 396.
So every page or post always has a postid and you can find out what it is by hovering over the edit link.
So 396 is the one I want. So all I have to do is go into my Dashboard and go to my primary sidebar and in my case I am just going to drag it up Genesis Club Slider and just put it in like that, and I’ve pre-prepared a tiny little slider called Short Slider.
And, it was page 396 that I wanted this slider to appear in only, on the primary sidebar. So I simply go: is_page(396). And then I hit save. Now that means that little slider should appear only on that page. So if I go to another page, which is page, 396 and hit return I get my little slider.
That’s how I would control that small change to a sidebar. In other words I mostly want the same thing I just wanted to add that one little thing in, just for this page. And if I got to another post that isn’t post 396 then there is no slider.
That’s easy enough to do, and the rules for putting and controlling Widget Logic, all of these, can be found on the WordPress site and I’ll show you a link in the post beneath this if you want to know how to identify pages and post and categories, tags – whatever you want to identify with Widget Logic it’s perfectly possible and there is a page in the Codex of WordPress that will show you how to do that.
But supposing I don’t want to do a small change like that, supposing what I actually want for this actual page is to get rid of this sidebar all together, and instead of having the sidebar at all I want to just have a different slider in this sidebar.
Now I am using sliders, you could have whatever you want. I am just saying, supposing I didn’t want this sidebar at all I just wanted something completely different then how would I do that?
Well there is a plugin, it’s a free plugin called Content Aware Sidebars that is very good, but I think the interface to it, the user interface isn’t that obvious so I am just going to show you how I would do that.
So I go into my Dashboard and the first thing I’ll do is I may as well just get rid of what I did earlier so we don’t want that at all anymore.
And I go into Sidebars which is what you get if you install the Content Aware Sidebar’s plugin and I’d simply say: Add New.
Okay when you first go into it this is what it looks like and it’s not obvious what you need to do. So I am just going to give my new sidebar a title, so I am going to call it: Slider only. Because it’s going to have a slider in it.
You can just look at these down here and say, now which post or page or condition do I want for this new primary sidebar to appear in? Now I’ve chosen it to appear only on a page.
So I’d open up pages, and I want it to only appear let’s say on Content Aware Sidebars Demo; which is one of my pages. So I check that box like that.
Now you see that when I check the box nothing happens. This add to group button doesn’t light up so it looks like you know “what’s going on here”, so just check that box and then go over here and say: Add new group.
As soon as you’ve added the new group that button become alive and then you can click it to add content to where sidebars into the condition group.
Once it’s done that, all you have to do then is say okay for this particular page do I want the new sidebar to appear when the page is in its singular format or in some sort of archive capacity. And for us because it’s a page I will just leave it a singular and archive, you could just put singular actually if you wanted to but I am going to leave it at singular and archive.
And then I want to either replace the primary sidebar, you’ve got a choice of all the different widget areas, but I want to replace the primary sidebar, I could merge it with the primary sidebar, but I don’t want to do that I just want to replace it and because I’m replacing it then there is no need for this merge position that’s irrelevant. It doesn’t matter if it says: ‘top’ or ‘bottom’.
So I am replacing the primary sidebar. When I am in Content Aware Sidebars Demo page, and that’s it and then I hit save.
All right, when it says: Condition Group is saved I can then publish that.
Now when that’s done I can click on all sidebars, and see I’ve got a sidebar now called Slide Bar Only. Now I can go into appearance/widgets and it’s got a color on it to help you see it, but I’ve got a brand new widget area now that wasn’t there before and that widget area knows to only appear when I am looking at the page called Content Aware Sidebars Demo.
So all I need to do is open it up and drag in a widget. I am going to go for my fixed slider again, only this time I am going to put the slightly bigger slider; I am not going to use short slider, I am going to use tall slider, and I don’t need to fill in any widget logic stuff because it already encapsulated in the meaning of this that it will replace, see it says there, the primary sidebar when we are on that page and only when we are on that page.
Replacement WordPress Sidebar
So if I hit save, and if I go back now to one of the other pages on the site and then do a refresh we should see this same sidebar, the same old sidebar that we always had.
And in fact if we go to one of the other categories like WordPress it doesn’t matter where I go we’ve got the same old sidebar. But if I go to Content Aware Sidebars Demo which is the other page I created we should see that this has got a completely different slide bar in it and in fact it only contains my tall slider that I created earlier.
And if you look you’ll see there is nothing beneath it because that’s all I put in that slide bar. So very easy to do.