Jump to content
Sign in to follow this  
dscher

How to call a Sidebar in a hook on Feature page?

Recommended Posts

dscher

Hi, I'm adding a secondary sidebar to my site and would like to keep it in the same space on a Feature page where it is on all other pages. Adding a Feature pushes the entire content area down and that takes the sidebar with it; I'd prefer to make the Feature smaller and add the sidebar to the Feature's content area. I have seen someone else recommend just using a negative margin on my sidebar CSS but it seems like using a Hook("pagelines_before_feature) to call the sidebar would be more functional...the problem is that I have no idea what PHP to put into my function to call the sidebar. I know this will work as I have thrown in the sidebar's HTML from another page into a hook and it goes there fine, but it's obviously static to do it this way and if I change the sidebar at any time the content wouldn't match. Any help would be greatly appreciated!

Share this post


Link to post
Share on other sites
catrina

You can use sidebar CSS (with a specific selector that changes the sidebar only on the page where the feature slider is) to move the sidebar and resize the feature slider. Can you post a link to your site?


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
dscher

Thanks Catrina, The problem is that I'm using an "Under Construction" plugin so you can't see the site unless you go through the backend. I don't see somewhere here to attach images. Isn't there a way to call the Sidebar with a hook? Wouldn't that make more sense since you'd then be using the system hooks? You can't tell much from the images honestly because, as I stated in my original post, I used a hook(pagelines_before_feature) to put the Sidebar in the Feature area...but right now it's just copied and pasted HTML; I was hoping to figure out how to call the sidebar with a hook. Thanks again, any input is greatly appreciated.

Share this post


Link to post
Share on other sites
dscher

Catrina, after looking through the Wordpress forum quickly, it seems as though there might not be a way to call the Sidebar using a hook; http://wordpress.org/support/topic/hookfilter Is that correct? If so...if you could share how to get the sidebar in the Features section using CSS that would be great! Thanks so much.

Share this post


Link to post
Share on other sites
catrina

Yes, that is correct. CSS would be the best way, but it's difficult to figure out what CSS if I can't view your site. Can you tell me what kind of sidebar are you using (primary, secondary, etc.)?


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
dscher

It's a primary sidebar. Sorry you can't see the site, but I prefer to leave the Under Construction front-page up for now.

Share this post


Link to post
Share on other sites
catrina

Please try adding this to your Custom CSS:

#sidebar_primary {margin-top: -100px;}


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
dscher

That actually moves the sidebar up on every other page as well; it is only on the page with the Feature that I would like the Sidebar to be higher than where it is. In your first reply you mentioned that there is a way to do that only on the Feature page...if that's possible that would definitely seem to work. Thanks for your continued help!

Share this post


Link to post
Share on other sites
catrina

Ah, yes, here's the correct code:

body.home #sidebar_primary {margin-top: -100px;}


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
dscher

Catrina, that actually does work to push up the sidebar on just the Features page...but as you can see in the linked-to image, it does not push up the background of the sidebar and it(the sidebar) appears to begin getting clipped once it enters into the area where the Feature is. Any more ideas on how to get it up there and not get clipped? SOh4d.jpg Thanks for your continued help. :)

Share this post


Link to post
Share on other sites
kgstew

I'm going to bump this up for some additional developer support and see if someone has a solution for you.

Share this post


Link to post
Share on other sites
dscher

Hi Catrina, unfortunately there is an "Under Construction" plugin that I'm using which won't allow you to see the site. I'll just wait until the site is live and then send it to you if that is okay. It will be easier to sort out at that point. For now, I'm using a hook to paste in the HTML that recreates the sidebar on every other page which looks okay, but obviously if the content of that sidebar is changed the static content on the Features sidebar won't be. Anyway, I'll send you the link when the site is up and then maybe you can help. Thanks a lot for your help thus far....

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×