Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #993347
    ncfan2030
    Participant

    I am trying to add a menu in the top bar of my site:

    http://lakeside.gkdevserver.com/

    I see that the solution below is quite old and it does not seem to be working:

    https://community.theme.co/forums/topic/menu-in-top-bar/

    Is there a current updated solution here? Thanks in advance! 🙂

    #993420
    Paul R
    Moderator

    Hi,

    You can try this.

    1. Create file _topbar.php in wp-content/themes/x-child/framework/views/global and copy the code below into that file.

    
    <?php
    
    // =============================================================================
    // VIEWS/GLOBAL/_TOPBAR.PHP
    // -----------------------------------------------------------------------------
    // Includes topbar output.
    // =============================================================================
    
    ?>
    
    <?php if ( x_get_option( 'x_topbar_display' ) == '1' ) : ?>
    
      <div class="x-topbar">
        <div class="x-topbar-inner x-container max width">
          <?php if ( x_get_option( 'x_topbar_content' ) != '' ) : ?>
          <p class="p-info"><?php echo x_get_option( 'x_topbar_content' ); ?></p>
          <?php endif; ?>
          <?php
            wp_nav_menu( array(
            'menu'              => 'main-menu',
            'container'         => 'div',
            'container_class'   => 'x-topbar-nav',
            'menu_class'        => 'x-nav',
            'link_before'       => '<span>',
            'link_after'        => '</span>',
            'depth'             => 1,
          ) );
          ?>
          <?php x_social_global(); ?>
        </div>
      </div>
    
    <?php endif; ?>
    

    Change main-menu with the name of your menu

    2. Add this in Appearance > Customize > Custom > Edit Global CSS

    
    .x-topbar-nav,
    .x-topbar-nav li {
        display:inline-block;
    }
    
    .x-topbar-nav li a { 
        padding:5px 10px;
    }
    

    Hope that helps.

    #993876
    ncfan2030
    Participant
    This reply has been marked as private.
    #994037
    Darshana
    Moderator
    This reply has been marked as private.
    #994075
    ncfan2030
    Participant
    This reply has been marked as private.
    #994139
    Darshana
    Moderator

    Hi there,

    Please provide us with your FTP credentials to check your code.

    Thanks!

    #994160
    ncfan2030
    Participant
    This reply has been marked as private.
    #994192
    Darshana
    Moderator
    This reply has been marked as private.
    #994237
    ncfan2030
    Participant
    This reply has been marked as private.
    #994557
    Darshana
    Moderator

    Hi there,

    I have resolved your issues and now you should be able to assign links to your Topbar menu.

    Cheers!

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