Support » Plugins » Hacks » Having 2 different sidebars (problem)

  • 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!

Viewing 1 replies (of 1 total)
  • Do you have a file named sidebar2.php? If not then copy sidebar.php and rename it. Then make sure index.php (the blog) is calling for sidebar2.php

Viewing 1 replies (of 1 total)
  • The topic ‘Having 2 different sidebars (problem)’ is closed to new replies.