Kubrick 1.5 sidebar
-
Hello does anyone know how i can add a extra side bar in kubric 1.5 I have tryed to google and found a site http://www.blogohblog.com/adding-extra-sidebar-to-your-wordpress-theme/ but when i come to step 3 editing the <?php include (TEMPLATEPATH . ‘/sidebar.php’); ?> Anyone know what i can do to ad an extra sidebar? Maby an more easy way?
-
well, if you registered the sidebar properly in functions.php you can use it like this…. create the new sidebar file and name it sidebar-something.php
Example:
here’s the code from my functions.phpif ( function_exists('register_sidebar') ) register_sidebar(array( 'name'=>'Sidebar', 'before_widget' => '<li class="widget" id="%1$s"><div class="widgetBG">', 'after_widget' => '</div><div class="widgetBottom"></div></li>', 'before_title' => '<div class="widgetTitle">', 'after_title' => '</div>', )); register_sidebar(array( 'name'=>'TopWidget', 'before_widget' => '<li class="topWidget" id="%1$s"><div class="topWidgetBG">', 'after_widget' => '</div><div class="topWidgetBottom"></div></li>', 'before_title' => '<div class="topWidgetTitle"><span class="topText">', 'after_title' => '</span></div>', ));
this creates 2 sidebars…. one named Sidebar, and one named TopWidget (don’t get confused by the before/after widget and before/after title, that’s formatting stuff that I use)
After that, I created two files… one was just the standard sidebar.php, and one was named sidebar-topWidget.php
now, I have registered 2 sidebars, and I have created them. To call them I do this:
<?php get_sidebar(); ?>
calls the normal sidebar, the one named sidebar.php, I’m pretty sure this is how kubrick calls the standard sidebarto use my second sidebar, I call this:
<?php get_sidebar ('topWidget'); ?>
this calls up the second sidebar, which in my case was named sidebar-topWidget.phpwill i be putting this code in sidebar-topWidget.php
<div> <ul> <?php if ( function_exists('dynamic_sidebar') && ('dynamic_topWidget' ) : else : ?> <?php endif; ?> </ul> </div>
or am i just totaly wrong here?
- The topic ‘Kubrick 1.5 sidebar’ is closed to new replies.