Hi, I am trying to create a sidebar in the header. I’m using the following code in my functions.php file:
<?php
/**
* Register Widget Area.
*
*/
function header_widgets_init() {
register_sidebar( array(
‘name’ => ‘Header Sidebar’,
‘id’ => ‘header_sidebar’,
‘before_widget’ => ‘<div>’,
‘after_widget’ => ‘</div>’,
‘before_title’ => ‘<h2 class=”rounded”>’,
‘after_title’ => ‘</h2>’,
) );
}
add_action( ‘widgets_init’, ‘header_widgets_init’ );
?>
However when I insert the following code into my header.php file, depending on where I place it, the side bar either goes to the very top of the page (above the title (and contact bar) or below the page title (right before the page content):
<?php if ( !function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(‘header_sidebar’) ) :
endif; ?>
Ideally, I’d like to have it located right below the Logo/navigation menu, but above the page title. Is this possible?
Thanks