Skip to content

Instantly share code, notes, and snippets.

@GaryJones
Created May 30, 2013 09:00
Show Gist options
  • Select an option

  • Save GaryJones/5676637 to your computer and use it in GitHub Desktop.

Select an option

Save GaryJones/5676637 to your computer and use it in GitHub Desktop.
Genesis - Add Top Menu
<?php
add_filter( 'genesis_default_menus', 'prefix_register_top_menu' );
function prefix_register_top_menu( array $menus ) {
$menus['top'] = __( 'Top Navigation Menu', 'prefix-domain' );
return $menus;
}
add_action('genesis_before_header', 'prefix_do_top_nav');
function prefix_do_top_nav() {
$menu_args = array(
'theme_location' => 'top',
'sort_column' => 'menu_order',
'container_class' => 'wrap',
'menu_class' => 'menu genesis-nav-menu menu-top',
);
?>
<nav class="nav-top" role="navigation" itemscope itemtype="http://schema.org/SiteNavigationElement">
<?php wp_nav_menu( $menu_args ); ?>
</nav>
<?php
}
/* Top Navigation
--------------------------------------------- */
.nav-top {
background: #222;
border-bottom: 1px solid #444;
}
.menu-top a {
background: #222;
padding: 14px 20px;
padding: 1.4rem 2rem;
}
.menu-top a:hover {
background: #111;
color: #fff;
}
.menu-top .current-menu-item > a {
background: #d24d33;
color: #fff;
}
.menu-top .sub-menu a {
background: #222;
color: #ccc;
}
.menu-top .sub-menu a:hover {
background: #111;
color: #fff;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment