Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
function genesis_header_menu_wrap( $menu ) {
if ( ! genesis_html5() )
return $menu;
return sprintf( '<nav>', genesis_attr( 'nav-header' ) ) . $menu . '</nav>';
}
<?php
add_action( 'genesis_before_header', 'vmf_custom_responsive_menu' );
function vmf_custom_responsive_menu() {
remove_action( 'genesis_header', 'genesis_do_header' );
add_action( 'genesis_header', 'vmf_genesis_do_responsive_header' );
}
function vmf_genesis_do_responsive_header() {
global $wp_registered_sidebars;
genesis_markup( array(
'html5' => '<div>',
'xhtml' => '<div id="title-area">', 'context' => 'title-area', ) );
do_action( 'genesis_site_title' );
do_action( 'genesis_site_description' );
echo '</div>';
if ( ( isset( $wp_registered_sidebars['header-right'] ) && is_active_sidebar( 'header-right' ) ) || has_action( 'genesis_header_right' ) ) {
genesis_markup( array(
'html5' => '<aside>',
'xhtml' => '<div class="widget-area header-widget-area">',
'context' => 'header-widget-area', ) );
do_action( 'genesis_header_right' );
add_filter( 'wp_nav_menu_args', 'genesis_header_menu_args' );
add_filter( 'wp_nav_menu', 'vmf_genesis_header_menu_wrap' );
dynamic_sidebar( 'header-right' );
remove_filter( 'wp_nav_menu_args', 'genesis_header_menu_args' );
remove_filter( 'wp_nav_menu', 'vmf_genesis_header_menu_wrap' );
genesis_markup( array(
'html5' => '</div></aside>',
'xhtml' => '</div>',
) );
}
}
function vmf_genesis_header_menu_wrap( $menu ) {
if ( ! genesis_html5() )
return $menu;
$responsive = '<div class="responsive-primary-menu-container">';
$responsive .= '<div class="responsive-menu-icon">';
$responsive .= ' ';
$responsive .= '</div>';
$responsive .= '<h3 class="mobile-primary-toggle">Navigation</h3>';
$responsive .= '</div>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.