Positioning custom widget area in header
-
Hi
I am trying to position a widget in the header. I have read through the comments in these support forums, but can’t seem to style the widget (area?). I am using the Wind Theme. The widget area displays in the header, but the seems to be the full width of the header, and it’s not positioned at the top. How do I style the widget in css? Which would be in the wind.css file I presume. It’s doing my head in.This is the exert from core-functions.php to register the widget
function wind_core_sidebars() { $sidebars = array ( 'full-widget-area' => array( 'name' => __( 'Blog Widget Area (Full)', 'wind' ), 'description' => __( 'Available for Left or Right sidebar layout.', 'wind' ), ), 'first-widget-area' => array( 'name' => __( 'Blog Widget Area 1', 'wind' ), 'description' => __( 'Blog Widget Area 1', 'wind' ), ), 'second-widget-area' => array( 'name' => __( 'Blog Widget Area 2', 'wind' ), 'description' => __( 'Blog Widget Area 2', 'wind' ), ), // GH Reference - Added Header Widget Area 'header-widget-area' => array( 'name' => __( 'Header Widget Area', 'wind' ), 'description' => __( 'Header Widget Area', 'wind' ), ), 'first-home-widget-area' => array( 'name' => __( 'Home Widget Area 1', 'wind' ), 'description' => __( 'Home Widget Area 1', 'wind' ), ), 'second-home-widget-area' => array( 'name' => __( 'Home Widget Area 2', 'wind' ), 'description' => __( 'Home Widget Area 2', 'wind' ), ), 'third-home-widget-area' => array( 'name' => __( 'Home Widget Area 3', 'wind' ), 'description' => __( 'Home Widget Area 3', 'wind' ), ), 'fourth-home-widget-area' => array( 'name' => __( 'Home Widget Area 4', 'wind' ), 'description' => __( 'Home Widget Area 4', 'wind' ), ), 'fifth-home-widget-area' => array( 'name' => __( 'Home Widget Area 5', 'wind' ), 'description' => __( 'Home Widget Area 5', 'wind' ), ), 'first-footer-widget-area' => array( 'name' => __( 'Footer Widget Area 1', 'wind' ), 'description' => __( 'Footer Widget Area 1', 'wind' ), ), 'second-footer-widget-area' => array( 'name' => __( 'Footer Widget Area 2', 'wind' ), 'description' => __( 'Footer Widget Area 2', 'wind' ), ), 'third-footer-widget-area' => array( 'name' => __( 'Footer Widget Area 3', 'wind' ), 'description' => __( 'Footer Widget Area 3', 'wind' ), ), 'fourth-footer-widget-area' => array( 'name' => __( 'Footer Widget Area 4', 'wind' ), 'description' => __( 'Footer Widget Area 4', 'wind' ), ), ); return apply_filters( 'wind_core_sidebars', $sidebars ); } function wind_widgets_init() { register_widget( 'Wind_Recent_Post' ); register_widget( 'Wind_Navigation' ); $sidebars = wind_core_sidebars(); foreach ( $sidebars as $id => $sidebar ) { register_sidebar( array( 'id' => $id, 'name' => $sidebar['name'], 'description' => $sidebar['description'], 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', 'after_widget' => '</li>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>', ) ); } } add_action( 'widgets_init', 'wind_widgets_init' );
This is the code from header.php:
<body <?php body_class(); ?>> <div id="wrapper"> <header id="masthead" class="site-header clearfix"> <?php wind_top_menu(); ?> <?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('header-widget-area')) : else : ?> <div class="pre-widget"> <p><strong>Header Widget Area</strong></p> <p>Add some widgets via the WP Admin</p> </div> <?php endif; ?> </div>
And this is from wind.css; placed just above #site-description
.header-widget-area { position: fixed; top: 40px; left: 605px; }
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Positioning custom widget area in header’ is closed to new replies.