Tagged: x
-
AuthorPosts
-
June 22, 2016 at 10:00 am #1054444
bjmillerParticipantThink 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?
June 22, 2016 at 10:01 am #1054445
bjmillerParticipantThis reply has been marked as private.June 22, 2016 at 10:57 am #1054547
JadeModeratorHi 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.
June 22, 2016 at 1:01 pm #1054752
bjmillerParticipantThat is awesome. Is there a way to make the phone number clickable and also show up in mobile?
June 22, 2016 at 3:56 pm #1055091
NicoModeratorHi 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.
June 27, 2016 at 10:32 am #1061680
bjmillerParticipantThis reply has been marked as private.June 27, 2016 at 11:27 am #1061761
JoaoModeratorHi 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
June 27, 2016 at 2:45 pm #1062062
bjmillerParticipantThis reply has been marked as private.June 27, 2016 at 7:36 pm #1062393
JadeModeratorHi 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.
June 30, 2016 at 12:09 pm #1066978
bjmillerParticipantThis reply has been marked as private.June 30, 2016 at 7:35 pm #1067531
FriechModeratorHi 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!
July 1, 2016 at 9:04 am #1068400
bjmillerParticipantThis reply has been marked as private.July 1, 2016 at 9:19 am #1068416
JoaoModeratorHi 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
July 1, 2016 at 9:30 am #1068431
bjmillerParticipantIs 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.
July 1, 2016 at 10:15 am #1068490
bjmillerParticipantI got it. Thank you X themes for being top notch
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1054444 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
