Fixed sidebar – no CSS knowledge
-
Hi there! I’ve searched the forums and been unable to find an answer to this question that I can implement successfully… I’m trying to create a fixed sidebar that will remain in place while content scrolls. I have zero CSS knowledge (though I do have some 15-year-old html knowledge), so a lot of what I’ve looked at here is really hard for me to understand.
My website is http://www.jenniesteinberg.com
I see two files that look like they might be my sidebar. One is sidebar-default.php and looks like this:
<?php /** * Template part file for default sidebar. * * * @package Raindrops * @since Raindrops 0.1 */ ?> <div class="lsidebar"> <ul> <?php if (!dynamic_sidebar('sidebar-1')){ raindrops_sidebar_menus( 'default' ); } ?> </ul> </div>And the other is just called “Sidebar” and then says “sidebar.php” in parentheses. That code looks like this:
<?php /** * Template part file for Sidebar. * * * @package Raindrops */ ?> <div class="sidebar"> <ul> <?php if (!dynamic_sidebar('sidebar-1')){ ?> <?php wp_list_pages('title_li=<h2 class="h2">'. __( 'Pages', 'Raindrops').'</h2>' ); ?> <li><h2 class="h2"><?php _e( 'Archives', 'Raindrops' ); ?></h2> <ul> <?php wp_get_archives('type=monthly'); ?> </ul> </li> <?php wp_list_categories('show_count=1&title_li=<h2 class="h2">'. __( 'Categories', 'Raindrops'). '</h2>'); ?> <?php /* If this is the frontpage */ if ( is_front_page() || is_page() ) { ?> <?php wp_list_bookmarks(); ?> <li> <h2 class="h2">Meta<?php _e( 'Meta', 'Raindrops' ); ?></h2> <ul> <?php wp_register(); ?> <li> <?php wp_loginout(); ?> </li> <?php wp_meta(); ?> </ul> </li> <?php } ?> <?php } ?> </ul> </div>I am using Raindrops theme.
Which of these files do I need to modify in order to have the sidebar be fixed while website visitors scroll through text?
Thanks,
Jennie
-
Where in the code would that go?
it would possibly go into style.css;
for some reasons, adding this has the side effect of increasing the size of the sidebar (?)
instead, maybe try to use:
.yui-b { position: fixed; }(only checked in Firefox14 for the given link; not tested in any other browsers or any other pages of your site)
Thank you so much! How do I get the header to do the same?
Actually, I realize that’s a totally separate question. I’ll close this and open a new one – thanks for your help!
The topic ‘Fixed sidebar – no CSS knowledge’ is closed to new replies.