Hi,
If it is an advert then the better place may be above the content, and you might want to add a widget area to the "content top" below header and menu rather than fully across the header wasting real estate.
I published a post yesterday with this scenario and the Google hot spot graphic, there are three child themes in the post to download, the code may help you anyway in what you want, it is often better to just start again.
To add to an existing child theme:
Download the Left Sidebar Top Content open the zip and copy the file content-top.php across to the child theme.
In your style.css add:
/* Top Content Widget */
#content-top {
display: block;
margin: 0 auto;
text-align: center;
width: 100%;
}
Copy index.php and or page.php from twenty ten to your child theme and find:
<div id="content" role="main">
<?php
Add a two line call to the file with get_template_part( 'content','top' )
So you will have:
<div id="content" role="main">
<?php
/* Add our Content Top Widget Area Here */
get_template_part( 'content', 'top' );
/* Run the loop to output the posts.
* If you want to overload this in a child theme then include a file
* called loop-index.php and that will be used instead.
*/
get_template_part( 'loop', 'index' );
?>
</div><!-- #content -->
Last in your child themes functions.php add:
add_action( 'after_setup_theme', 'content_theme_setup' );
/** This function will hold our new calls and over-rides */
if ( !function_exists( 'content_theme_setup' ) ):
function content_theme_setup() {
/** Add our Extra Widgetized Areas */
function child_widgets_init() {
// Load our Widget Area Names and ID's into an Array
$widgets = array (
array(
"name" => "Content Top Widget",
"id" => "content-top-widget-area")
);
/* Loop through the array and add our Widgetised areas */
foreach ($widgets as $widget) {
register_sidebar( array(
'name' => __( $widget['name'], 'twentyten' ),
'id' => $widget['id'],
'description' => __( $widget['name'] .' Area', 'twentyten' ),
'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
'after_widget' => '</li>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
}
}
/** Register sidebars by running twentyten_widgets_init() on the widgets_init hook. */
add_action( 'widgets_init', 'child_widgets_init' );
}
endif;
Now just ad your text widget with te adSense code, or it could be a slideshow etc:, to the new widget area.
HTH
David