Problems after creating new widget area
-
Hello,
I’m actually setting up a new menu above the logo and header banner. I’m using the jQuery mega menu for this purpose.
I have registered the nav menu in functions.php as :
register_nav_menus( array( 'primary' => __( 'Primary Navigation', 'gonzo' ), 'mobile' => __( 'Mobile Navigation', 'gonzo' ), 'header banner' => __( 'Header Banner Menu', 'gonzo' ) ) );
I have also called the widget in the Header.php using :
<div id="header-widgets"> <?php dynamic_sidebar('header-widgets'); ?> </div> <?php if ( ! dynamic_sidebar( 'Header Banner' ) ) : endif; ?>
I have added this in the functions.php:
if (function_exists('register_sidebar')) { register_sidebar(array( 'id' => 'header-widgets', 'name' => 'Header widgets', 'description' => 'Widget area below the header', 'before_widget' => '<div id="%1$s">', 'after_widget' => '</div>', 'before_title' => '<h4>', 'after_title' => '</h4>' )); }
The problem is, when I add all of this code, the sidebar disappears and only nav menu shows, and when and when I remove the entire code the nav menu disappears and the sidebar retains. Please Help!
There is some problem in the functions.php code. Could someone please help me out?!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Problems after creating new widget area’ is closed to new replies.