Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1133051
    dozingquinn
    Participant

    Hello,

    Is it possible to add a secondary navigation bar (under the primary navigation bar) so it only shows on one page?

    Thanks

    #1133247
    Christopher
    Moderator

    Hi there,

    Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

    Please copy _navbar.php from framework/views/global and put it in the same path inside child theme, replace existing code with following :

    <?php
    
    // =============================================================================
    // VIEWS/GLOBAL/_NAVBAR.PHP
    // -----------------------------------------------------------------------------
    // Outputs the navbar.
    // =============================================================================
    
    $navbar_position = x_get_navbar_positioning();
    $logo_nav_layout = x_get_logo_navigation_layout();
    $is_one_page_nav = x_is_one_page_navigation();
    
    ?>
    
    <?php if ( ( $navbar_position == 'static-top' || $navbar_position == 'fixed-top' || $is_one_page_nav ) && $logo_nav_layout == 'stacked' ) : ?>
    
      <div class="x-logobar">
        <div class="x-logobar-inner">
          <div class="x-container max width">
            <?php x_get_view( 'global', '_brand' ); ?>
          </div>
        </div> <!-- end .x-logobar-inner -->
      </div> <!-- end .x-logobar -->
    
      <div class="x-navbar-wrap">
        <div class="<?php x_navbar_class(); ?>">
          <div class="x-navbar-inner">
            <div class="x-container max width">
                          <?php x_get_view( 'global', '_nav', 'primary' ); ?>
    
              <?php if( is_page('put page id')): ?>
                   <?php
                        wp_nav_menu( array(
                          'menu'           => 'custom-menu',
                          'container'      => false,
                          'menu_class'     => 'x-nav sf-menu',
                           'container'       => 'div',
                        ) );
                   ?>
              <?php endif; ?>
            </div>
          </div> <!-- end .x-navbar-inner -->
        </div> <!-- end .x-navbar -->
      </div> <!-- end .x-navbar-wrap -->
    
    <?php else : ?>
    
      <div class="x-navbar-wrap">
        <div class="<?php x_navbar_class(); ?>">
          <div class="x-navbar-inner">
            <div class="x-container max width">
              <?php x_get_view( 'global', '_brand' ); ?>
                            <?php x_get_view( 'global', '_nav', 'primary' ); ?>
    
              <?php if( is_page('put page id') ): ?>
                   <?php
                        wp_nav_menu( array(
                          'menu'           => 'custom-menu',
                          'container'      => false,
                          'menu_class'     => 'x-nav sf-menu',
                           'container'       => 'div',
                        ) );
                   ?>
              <?php endif; ?>
            </div>
          </div> <!-- end .x-navbar-inner -->
        </div> <!-- end .x-navbar -->
      </div> <!-- end .x-navbar-wrap -->
    
    <?php endif; ?>

    Create a menu and name it ‘custom-menu’ and add menu items
    Put page ID instead of put page id in provided code.

    Hope it helps.

  • <script> jQuery(function($){ $("#no-reply-1133051 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>