Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function register_my_menu() {
- register_nav_menu('new-menu',__( 'New Menu' ));
- }
- add_action( 'init', 'register_my_menu' );
- if ( ! function_exists( 'nepalbuzz_new_menu' ) ) :
- /**
- * Shows the New Menu
- *
- * default load in sidebar-header-right.php
- */
- function nepalbuzz_new_menu() {
- $options = nepalbuzz_get_options();
- if ( $options['primary_menu_disable'] ) {
- // Bail if primary menu is disabled.
- return;
- }
- ?>
- <button id="menu-toggle-primary-new" class="menu-toggle"><span class="menu-label"><?php esc_html_e( 'Menu', 'nepalbuzz-pro' ); ?></span></button>
- <div id="primary-menu-new">
- <div class="wrapper">
- <div id="site-header-menu-new" class="menu-primary">
- <nav id="site-navigation" class="main-navigation nav-primary <?php echo ( !$options['primary_search_disable'] ) ? 'search-enabled' : '';?>" role="navigation" aria-label="<?php esc_attr_e( 'Primary Menu', 'nepalbuzz-pro' ); ?>">
- <h3 class="screen-reader-text"><?php _e( 'Primary menu', 'nepalbuzz-pro' ); ?></h3>
- <?php
- if ( has_nav_menu( 'primary' ) ) {
- $args = array(
- 'theme_location' => 'new-menu',
- 'menu_class' => 'menu nepalbuzz-nav-menu',
- 'container' => false
- );
- wp_nav_menu( $args );
- }
- else {
- wp_page_menu( array( 'menu_class' => 'default-page-menu' ) );
- }
- if( !$options['primary_search_disable'] ) :
- ?>
- <div id="search-toggle">
- <a class="screen-reader-text" href="#search-container"><?php esc_html_e( 'Search', 'nepalbuzz-pro' ); ?></a>
- </div>
- <div id="search-container" class="displaynone">
- <?php get_Search_form(); ?>
- </div>
- <?php
- endif;
- ?>
- </nav><!-- .nav-primary -->
- </div><!-- #site-header-menu -->
- </div><!-- .wrapper -->
- </div><!-- #primary-menu-wrapper -->
- <?php
- }
- endif; //nepalbuzz_primary_menu
- add_action( 'nepalbuzz_header', 'nepalbuzz_new_menu', 30 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement