I'm trying to use this answer (http://themeshaper.com/forums/topic/widgets-in-the-header/) to put two widgets in my header, one on each side of the title/description. (Sorry for the double post, but nobody seems to be monitoring that original topic.)
So far, so good - except that I'm getting the right widget below the line and can't seem to get it to move up into line. I know I'm doing something stupid and will smack myself in the forehead when you show me the error of my ways:
Here's the CSS in style.css in my child theme:
'#header_box {
clear: both;
margin: 0 auto;
overflow: hidden;
position: relative;
width: 960px;
}
/* Moves blog name & description to the center */
#branding {
float: right;
width: 400px;
margin: 0 320px 0 0;
padding: 50px 0 0 0;
}
/* Moves the new widgetized area to the left and levels it with #branding */
#headerleft-aside {
float: left;
width: 190px;
padding: 50px 0 0 0;
margin: 0 0 0 0;
}
/* Moves the new widgetized area to the right and levels it with #branding */
#headerright-aside {
float: right;
width: 220px;
padding: 0 0 0 0;
margin: 0 0 0 0;
}
/* This will clear the floats and keeps the access bottom line
from jumping into the air */
#access {
clear: both;
}
'
And here's what I added to my child theme functions.php:
'function my_widgets_init() {
register_sidebar(array(
'name' => 'Header Left Aside',
'id' => 'headerleft-aside',
'before_widget' => '<li id="%1$s" class="widgetcontainer %2$s">',
'after_widget' => "\n",
'before_title' => "<h3 class=\"widgettitle\">",
'after_title' => "</h3>\n",
));
register_sidebar(array(
'name' => 'Header Right Aside',
'id' => 'headerright-aside',
'before_widget' => '<li id="%1$s" class="widgetcontainer %2$s">',
'after_widget' => "\n",
'before_title' => "<h3 class=\"widgettitle\">",
'after_title' => "</h3>\n",
));
}
add_action( 'init', 'my_widgets_init' );
// adding the widget areas to your child theme header
function my_header_widgets() {
if ( function_exists('dynamic_sidebar') && is_sidebar_active('headerleft-aside') ) {
echo '<div id="headerleft-aside" class="aside">'. "\n" . '<ul class="xoxo">' . "\n";
dynamic_sidebar('headerleft-aside');
echo '' . "\n" . ''. "\n";
echo '' . "\n" . '</div><!-- #headerleft-aside .aside -->'. "\n";
echo "\n" . '</div><!-- #header-box -->'. "\n";
}
if ( function_exists('dynamic_sidebar') && is_sidebar_active('headerright-aside') ) {
echo '<div id="headerright-aside" class="aside">'. "\n" . '<ul class="xoxo">' . "\n";
dynamic_sidebar('headerright-aside');
echo '' . "\n" . ''. "\n";
echo '' . "\n" . '</div><!-- #headerright-aside .aside -->'. "\n";
echo "\n" . '</div><!-- #header-box -->'. "\n";
}
}
add_action('thematic_header', 'my_header_widgets', 8);
function remove_branding() {
remove_action('thematic_header','thematic_brandingopen',1);
}
add_action('init', 'remove_branding');
function my_brandingopen() { ?>
<div id="header_box">
<div id="branding">
<?php }
add_action('thematic_header','my_brandingopen',1);
?>'