Skip to content

Instantly share code, notes, and snippets.

@catchthemes
Created August 18, 2014 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save catchthemes/d7c8e39c6490c80b3eca to your computer and use it in GitHub Desktop.
Save catchthemes/d7c8e39c6490c80b3eca to your computer and use it in GitHub Desktop.
Catch Everest Child Theme Fucntion to add in Menus
<?php
/**
* Register Menus
*
* @uses after_setup_theme action
*/
function catcheverest_child_setup() {
/**
* This feature enables custom-menus support for a theme.
* @see http://codex.wordpress.org/Function_Reference/register_nav_menus
*/
register_nav_menus(array(
'primary' => __( 'Primary Menu', 'catcheverest' ),
'footer' => __( 'Footer Menu', 'catcheverest' )
) );
}
add_action( 'after_setup_theme', 'catcheverest_child_setup' );
/**
* Shows the Footer Menu
*
* @uses catcheverest_site_generator action to add it above site generator
*/
function catcheverest_footer_menu() { ?>
<div id="footer-menu">
<nav id="access" role="navigation">
<h2 class="assistive-text"><?php _e( 'Footer Menu', 'catcheverest' ); ?></h2>
<div class="assistive-text skip-link"><a href="#content" title="<?php esc_attr_e( 'Skip to Footer Content', 'catcheverest' ); ?>"><?php _e( 'Skip to Footer Content', 'catcheverest' ); ?></a></div>
<?php
if ( has_nav_menu( 'footer' ) ) {
$catcheverest_footer_menu = array(
'theme_location' => 'footer',
'depth' => 1,
'container_class' => 'menu-header-container',
'items_wrap' => '<ul class="menu">%3$s</ul>'
);
wp_nav_menu( $catcheverest_footer_menu );
}
?>
</nav><!-- .site-navigation .main-navigation -->
</div>
<?php
}
add_action( 'catcheverest_site_generator', 'catcheverest_footer_menu', 5 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment