Skip to content

Instantly share code, notes, and snippets.

@sevenspark

sevenspark/_nav-primary.php Secret

Created Nov 12, 2014
Embed
What would you like to do?
<?php
// =============================================================================
// VIEWS/GLOBAL/_NAV-PRIMARY.PHP
// -----------------------------------------------------------------------------
// Outputs the primary nav.
// Modified for child theme to display UberMenu if UberMenu is active
// =============================================================================
?>
<?php if( function_exists( 'ubermenu' ) ): ?>
<?php ubermenu( 'main' , array( 'theme_location' => 'primary' ) ); ?>
<?php else: ?>
<a href="#" class="x-btn-navbar collapsed" data-toggle="collapse" data-target=".x-nav-collapse">
<i class="x-icon-bars"></i><span class="visually-hidden"><?php _e( 'Navigation', '__x__' ); ?></span>
</a>
<nav class="x-nav-collapse collapse" role="navigation">
<?php
if ( x_is_one_page_navigation() ) :
wp_nav_menu( array(
'menu' => x_get_one_page_navigation_menu(),
'container' => false,
'menu_class' => 'x-nav x-nav-scrollspy sf-menu'
) );
elseif ( has_nav_menu( 'primary' ) ) :
wp_nav_menu( array(
'theme_location' => 'primary',
'container' => false,
'menu_class' => 'x-nav sf-menu',
) );
else :
echo '<ul class="x-nav"><li><a href="' . home_url( '/' ) . 'wp-admin/nav-menus.php">Assign a Menu</a></li></ul>';
endif;
?>
</nav> <!-- end .x-nav-collapse.collapse -->
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment