Help to add a right or left side bar
-
Hy there,
My name is John and perhaps I am the newest member of www.ads-software.com forum.
For couple of days i tried to start a job with my new website and i need some help. I use the theme D5 bussiness line. I activate this theme and i start to edit her. I have a problem. Hope my language is fine for you to understanding…
I need to add a sidebar on the left or on the right of my website. I read some topics about that but i didn’t understand too much. The problem is that in my widgets menu i saw the 6 sidebars like this:function.php
// Registers the Widgets and Sidebars for the site function d5businessline_widgets_init() { register_sidebar( array( 'name' => 'Primary Sidebar', 'id' => 'sidebar-1', 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => "</aside>", 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); register_sidebar( array( 'name' => 'Secondary Sidebar', 'id' => 'sidebar-2', 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => "</aside>", 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); register_sidebar( array( 'name' => 'Footer Area One', 'id' => 'sidebar-3', 'description' => 'An optional widget area for your site footer', 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => "</aside>", 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); register_sidebar( array( 'name' => 'Footer Area Two', 'id' => 'sidebar-4', 'description' => 'An optional widget area for your site footer', 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => "</aside>", 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); register_sidebar( array( 'name' => 'Footer Area Three', 'id' => 'sidebar-5', 'description' => 'An optional widget area for your site footer', 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => "</aside>", 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); register_sidebar( array( 'name' => 'Footer Area Four', 'id' => 'sidebar-6', 'description' => 'An optional widget area for your site footer', 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => "</aside>", 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); } add_action( 'widgets_init', 'd5businessline_widgets_init' );
If I try to add widgets to Foot area one, two, three, for everything works fine and the widgets are shown on the website. BUT if i try to add widgets on the Primary sidebar or on the Secondary sidebar nothing change on the website.
content of sidebar.php file:
<div id="right-sidebar"> <?php if ( ! dynamic_sidebar( 'sidebar-1' ) ) : ?> <aside id="archives" class="widget"> <h3 class="widget-title">Archives</h3> <ul> <?php wp_get_archives( array( 'type' => 'monthly' ) ); ?> </ul> </aside> <aside id="meta" class="widget"> <h3 class="widget-title">Meta</h3> <ul> <?php wp_register(); ?> <li><?php wp_loginout(); ?></li> <?php wp_meta(); ?> </ul> </aside> <?php endif; // end sidebar widget area ?> <?php dynamic_sidebar( 'sidebar-2' ); ?> </div>
sidebar-footer.php file:
if ( ! is_active_sidebar( 'sidebar-3' ) && ! is_active_sidebar( 'sidebar-4' ) && ! is_active_sidebar( 'sidebar-5' ) && ! is_active_sidebar( 'sidebar-6' ) ) return; // If we get this far, we have widgets. Let do this. ?> <div id="footer-sidebar"> <?php if ( is_active_sidebar( 'sidebar-3' ) ) : ?> <div class="first-widget"> <?php dynamic_sidebar( 'sidebar-3' ); ?> </div><!-- #first .widget-area --> <?php endif; ?> <?php if ( is_active_sidebar( 'sidebar-4' ) ) : ?> <div class="widgets"> <?php dynamic_sidebar( 'sidebar-4' ); ?> </div><!-- #second .widget-area --> <?php endif; ?> <?php if ( is_active_sidebar( 'sidebar-5' ) ) : ?> <div class="widgets"> <?php dynamic_sidebar( 'sidebar-5' ); ?> </div><!-- #third .widget-area --> <?php endif; ?> <?php if ( is_active_sidebar( 'sidebar-6' ) ) : ?> <div class="widgets"> <?php dynamic_sidebar( 'sidebar-6' ); ?> </div><!-- #fourth .widget-area --> <?php endif; ?> </div><!-- #footerwidget -->
Surely i need to make some modifications. I will be happy with any answer. Thanks a lot!
- The topic ‘Help to add a right or left side bar’ is closed to new replies.