Skip to content

Instantly share code, notes, and snippets.

@krmd
Created May 30, 2014 15:18
Show Gist options
  • Save krmd/d5c10c1f0c1f37323cfe to your computer and use it in GitHub Desktop.
Save krmd/d5c10c1f0c1f37323cfe to your computer and use it in GitHub Desktop.
WooTheme Canvas: Header Widget
if (function_exists('register_sidebar')) {
register_sidebar(array(
'name' => 'Header Widget',
'id' => 'header-widget',
'description' => 'This is a widgetized area in the right side of the header.',
'before_widget' => '<div id="%1$s" div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>'
));
add_action( 'woo_header_inside', 'custom_canvas_header' );
function custom_canvas_header () {
?>
<div id="header-widget">
<?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('header-widget')) : else : ?>
<?php endif; ?>
</div>
<?php
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment