Last active
December 22, 2015 04:49
-
-
Save michaelcarwile/6419682 to your computer and use it in GitHub Desktop.
Customize Genesis WordPress header
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// don't copy php tag | |
// inspired by: | |
// http://www.geoffreyrickaby.com/web-development/create-a-custom-header-in-genesis | |
//* Custom header | |
remove_action('genesis_header', 'genesis_do_header'); | |
remove_action('genesis_header', 'genesis_header_markup_open', 5); | |
remove_action('genesis_header', 'genesis_header_markup_close', 15); | |
add_action('genesis_header', 'custom_header'); | |
function custom_header() { ?> | |
<header class="site-header" role="banner" itemscope="itemscope" itemtype="http://schema.org/WPHeader"> | |
<div class="wrap"> | |
<div class="title-area"> | |
<h1 class="site-title" itemprop="headline"> | |
<a href="<?php bloginfo('url'); ?>"><?php echo get_bloginfo('name'); ?></a> | |
</h1> | |
</div> | |
<aside class="widget-area header-widget-area"> | |
<?php | |
if ( is_active_sidebar( 'header-right' ) || has_action( 'genesis_header_right' ) ) { | |
echo ''; | |
do_action( 'genesis_header_right' ); | |
add_filter( 'wp_nav_menu_args', 'genesis_header_menu_args' ); | |
dynamic_sidebar( 'header-right' ); | |
remove_filter( 'wp_nav_menu_args', 'genesis_header_menu_args' ); | |
echo ''; | |
} | |
?> | |
</aside> | |
</div> | |
</header> | |
<?php } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment