Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1054444
    bjmiller
    Participant

    Think I know how to center the menu and have my logo left but how would I add a phone number to the right of the menu?

    #1054445
    bjmiller
    Participant
    This reply has been marked as private.
    #1054547
    Jade
    Moderator

    Hi there,

    Please add this code in the customer:

    .masthead-inline .desktop .x-nav {
        float: none;
        margin: 0px auto;
        width: 755px;
        height: 50px;
    }
    
    nav.x-nav-wrap.desktop:after {
        content: "TELEPHONE NUMBER HERE";
        position: absolute;
        top: 18px;
        right: 0;
    }

    Hope this helps.

    #1054752
    bjmiller
    Participant

    That is awesome. Is there a way to make the phone number clickable and also show up in mobile?

    #1055091
    Nico
    Moderator

    Hi There,

    Try adding this in your customizer’s custom CSS:

    nav.x-nav-wrap.mobile:after{
    content: "256-547-5466";
        position: absolute;
    }

    Let us know how it goes.

    Thanks.

    #1061680
    bjmiller
    Participant
    This reply has been marked as private.
    #1061761
    Joao
    Moderator

    Hi There,

    Why not use the telephone number on the topbar instead?

    You can create a telephone link on the topbar make it float right. You can format it with the size you want.

    Also after that you can go to Appereance Customizer Header and align the navbar icons in order that it looks well spaced with the telephone above.

    You can add something like this on Appereance Customizer Header Topbar Content:

    <a class="tel" href="tel:+1800229933">+1800229933</a>
    

    Than add this code to Appereance Customizer Custom CSS

    .x-topbar .x-social-global {
      display: none;
    }
    .x-topbar .p-info {
      font-size: 25px;
      float: right;
    }

    This way your telephone will be always visible and clickable from mobile phones.

    Let us know your thoughts.

    Thanks

    Joao

    #1062062
    bjmiller
    Participant
    This reply has been marked as private.
    #1062393
    Jade
    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.

    Once you got the theme installed and activated, login through FTP then open the directory /wp-content/themes/x-child/framework/views/global then create the file _navbar.php then add this code to the file:

    <?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>
      </div>
    
      <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' ); ?>
            </div>
          </div>
        </div>
      </div>
    
    <?php else : ?>
    
      <div class="x-navbar-wrap">
        <div class="<?php x_navbar_class(); ?>">
          <div class="x-navbar-inner">
            <div class="x-container max width">
              <div id="nav-tel">
                  <a class="tel" href="tel:+1800229933">+1800229933</a>
              </div>        
              <?php x_get_view( 'global', '_brand' ); ?>
              <?php x_get_view( 'global', '_nav', 'primary' ); ?>         
            </div>
          </div>
        </div>
      </div>
    
    <?php endif; ?>

    Then add this in the customizer:

    #nav-tel {
        float: right;
        margin-top: 22px;
    }

    The please remove the customization suggested in the previous responses.

    Hope this helps.

    #1066978
    bjmiller
    Participant
    This reply has been marked as private.
    #1067531
    Friech
    Moderator

    Hi There,

    Did you follow Jade’s suggestion, how did that turns out? You can improve that to this:

    <?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>
      </div>
    
      <div class="x-navbar-wrap">
        <div class="<?php x_navbar_class(); ?>">
          <div class="x-navbar-inner">
            <div class="x-container max width">
            <div id="nav-tel" class="contact-number right"><a class="tel" href="tel:+1800229933">+1800229933</a></div>
              <?php x_get_view( 'global', '_nav', 'primary' ); ?>
            </div>
          </div>
        </div>
      </div>
    
    <?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' ); ?>
              <div id="nav-tel" class="contact-number right"><a class="tel" href="tel:+1800229933">+1800229933</a></div>
              <?php x_get_view( 'global', '_nav', 'primary' ); ?>
               
            </div>
          </div>
        </div>
      </div>
    
    <?php endif; ?>

    And update the given custom CSS to this:

    
    .contact-number {
    	font-size: 1.4em;
    	font-weight: bolder;
    	padding-top: 22px;
    	padding-left: 20px;
    }
    .contact-number .tel {color: white;}

    Feel free to adjust the values.

    And this CSS media query should bring your contact number above the menu when viewed on mobile.

    @media (max-width:  979px) {
    	.contact-number {
    	float: none;
        text-align: right;
    	}
    }

    Hope it helps, Cheers!

    #1068400
    bjmiller
    Participant
    This reply has been marked as private.
    #1068416
    Joao
    Moderator

    Hi There,

    Please add the folowing code to Appereance Customizer Custom CSS

    @media (max-width: 500px) {
    .x-navbar-fixed-top, .x-navbar-fixed-left, .x-navbar-fixed-right {
    position: fixed;
    }
    }

    Hope that helps

    Joao

    #1068431
    bjmiller
    Participant

    Is there any way for the logo to disappear and it just be the phone number and hamburger menu?

    The logo takes up a lot of mobile space.

    #1068490
    bjmiller
    Participant

    I got it. Thank you X themes for being top notch

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