extra widget area in header, or divide the widget area that is already there
-
Hellohello,
I am trying to put a extra widget area into the header, but until now I am unsuccesfull.
I managed to get the extra widget area in the widget section, but you can’t see him on my actual website. I don’t where to put the snippet in my header.php and do I have to add something more.
I used this code in function.php
<?php
/**
* Register Widget Area.
*
*/
function wpgyan_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’, ‘wpgyan_widgets_init’ );
?>And I should use this one in header.php
<?php if ( !function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(‘header_sidebar’) ) :
endif; ?>
But whe exactly in header.php should I put this and should I add something to this code?
Is it also possible to just divide the existing widget area in some kind of way?
Can someone help me??
Thank you in advance
Greetzz, Marleen
- The topic ‘extra widget area in header, or divide the widget area that is already there’ is closed to new replies.