WordPress.org

Ready to get started?Download WordPress

Forums

Having 2 sidebars (problem) (1 post)

  1. brownday
    Member
    Posted 4 years ago #

    I tried to add 2 different sidebars to add widgets.. I've done so but some problems occur such as the 2nd sidebar not having the same style as the other sidebars and when going back to the widgets menu the sidebars overwrite each other or appear in different places.

    you can see so on my website http://airportparking.org

    i want the pages to have the same sidebar and the BLOG page to have a separate sidebar.

    these are my files:

    functions.php:

    <?php 
    
    require_once(TEMPLATEPATH . '/epanel/custom_functions.php'); 
    
    require_once(TEMPLATEPATH . '/includes/functions/comments.php'); 
    
    require_once(TEMPLATEPATH . '/includes/functions/sidebars.php'); 
    
    load_theme_textdomain('eNews',get_template_directory().'/lang');
    
    require_once(TEMPLATEPATH . '/epanel/options_enews.php');
    
    require_once(TEMPLATEPATH . '/epanel/core_functions.php'); 
    
    require_once(TEMPLATEPATH . '/epanel/post_thumbnails_enews.php');
    
    function register_main_menus() {
    	register_nav_menus(
    		array(
    			'primary-menu' => __( 'Primary Menu' ),
    			'secondary-menu' => __( 'Secondary Menu' )
    		)
    	);
    };
    if (function_exists('register_nav_menus')) add_action( 'init', 'register_main_menus' );
    
    $wp_ver = substr($GLOBALS['wp_version'],0,3);
    if ($wp_ver >= 2.8) include(TEMPLATEPATH . '/includes/widgets.php'); 
    
    if ( function_exists('register_sidebar2') )
    register_sidebar(array('name'=>'Sidebar 2',));
    
    ?>

    /includes/functions/sidebars.php:

    <?php
    if ( function_exists('register_sidebar') )
        register_sidebar(array(
    	'name' => 'Sidebar',
        'before_widget' => '',
        'after_widget' => '</div> <!-- end sidebar block -->',
        'before_title' => '<h3>',
        'after_title' => '</h3><div class="sidebar-block">',
        ));
    
        if ( function_exists('register_sidebar') )
        register_sidebar(array(
    	'name' => 'Sidebar2',
        'before_widget' => '',
        'after_widget' => '</div> <!-- end sidebar block -->',
        'before_title' => '<h3>',
        'after_title' => '</h3><div class="sidebar-block">',
        ));
    
    if ( function_exists('register_sidebar') )
        register_sidebar(array(
    	'name' => 'Footer',
        'before_widget' => '<div class="widget">',
        'after_widget' => '</div> <!-- end widget -->',
        'before_title' => '<h4>',
        'after_title' => '</h4>',
        ));
    
    ?>

    if you need any more info let me know and thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic