How to widgetize a second sidebar
-
Hello all. My site is http://www.imasharpone.com. I’ve got two sidebars. The right sidebar allows widgets to be added but the left sidebar doesn’t, which I want to change. I’ve searched these forums up and down but none of what I’ve found quite works with this theme. The code for the left sidebar is quite different than the one for the right sidebar. I would think it should be a simple matter to copy the code for the right sidebar and make a new left sidebar with it but I’m not quite sure how.
-
so this will load the second sidebar, however I’m seeing the same class as for your primary sidebar.php, maybe that’s the issue because second one is located under sidebar1.php. Makes sense?
Kind of. Does that mean I should change the original sidebar to be “sc_menu1”?
you may try 🙂 but also widgetbar as well, in case that this one floats right, another one should left.
Just installed the Valentine theme and this seems to be working fine. And here’s how, very similar to what we had above, with one exception, no creation of the actual sidebar1.php.
Open your functions.php and make sure that we set this up as http://wordpress.pastebin.com/p6ivGTiS
Open header.php locate:
<ul id="sliding-navigation"> <?php if ( is_page() ) { echo $children; } else { wp_list_categories('title_li='); } ?> </ul>and let’s replace that with:
<ul id="sliding-navigation"> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(2) ) : ?> <?php endif; ?> </ul>Above that you will see:
<?php if ( is_page() ) { echo '<h2 class="submnu">Submenu</h2>'; } else { echo '<h2 class="submnu">Categories</h2>'; } ?>you can take that out as well to remove Categories title.
sidebar.php should have only this:
<div class="widgetbar"> <div class="sc_menu2"> <ul> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(1) ) : ?> <?php endif; ?> </ul> </div> </div>Login to your WordPress and add your widgets for the second sidebar and change the primary sidebar the way you need.
All set.
PS If you want to re-style the left sidebar you can.
Wow, you rock man. I set it all up per your instructions and it looks great. One question though: where do I tell the left sidebar to not scroll? I know we’ve been through this before but under the sliding-navigation part if I set it to anything but relative the whole left sidebar disappears. The whole thing does move up and down like the right sidebar, but then if you hover over it and scroll it scrolls within the sidebar.
Not a problem. I see the left one the same way as the right sidebar, they scroll with design. I must be missing something?
It does, but if you hover over the the left sidebar and move the mouse the sidebar scrolls within itself. Perhaps it has a fixed height and I need to make that bigger?
I was trying to scroll actually and you clearly said move the mouse LOL my bad definitely.
All right so we need to do this:
div.sc_menu_wrapper { height: 70%; }The height: 70%, just delete and problem solved.
Also noticing header isn’t all the way across, currently 70% and when you do that the header will kind of go to the left, instead of being centered, that’s expecially on 23″ display like mine.
Make it 100%.
.header { width: 100%; }Wow man, thank you so much. Looks perfect now. I did purposely put the header at 70% because if I didn’t the right sidebar ends up sitting on top of it but I’m sure I can push it down some so we don’t have that problem.
So, do you have paypal…I think I owe you 🙂
I am working with WordPress since the very first beginning, however just before month ago I’ve joined the forum, never helped here or any other place before, never been on any WP Camps either.
So actually I owe money to WordPress for putting the food on my table with the work I provide to my clients since late 2003.
When and if I assist is all I need, so no worries, just don’t stop using the WP and we’re good 😉
If this was all, could you please mark “resolved” from your end and feel free to come back whenever you have more questions.
Cheers,
EmilWill do. Thanks again. And for goodness sakes, go get some sleep 🙂
–Ima Sharpone
Thanks Ima, I will, some day…;)
The topic ‘How to widgetize a second sidebar’ is closed to new replies.