Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #870387

    danielfuze
    Participant

    Sorry for posting another question about how to add a phone number in the header, I’ve been reading through all of the threads that came up in the search but haven’t been able to even get a phone number to show up in my header.

    Right now I have a phone number in my top bar but that is not what I want. I want a phone number in the header, along with an image right below it like they have on this website: http://www.elevatedroofing.com/

    Thanks for your patience and understanding. I’ve just been going a little crazy trying to figure this out.

    #870734

    Rue Nel
    Moderator

    Hello There,

    Thanks for writing in! Is this, http://gxldsxxlpxst.cx/, the site in question? Since what you are trying to accomplish requires a template customization, we would like to suggest that you use 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 already have your child theme active and ready, please insert this following code in your child theme’s functions.php file.

    // Add phone and text next to the logo
    // =============================================================================
    function add_logo_text_number(){ ?>
      
      <div class="custom-text right pas">
        <span class="phone-number">#0987654321</span><br>
        <span class="address">Your adress here</span>
      </div>
    
    <?php }
    add_action('x_after_view_global__brand', 'add_logo_text_number');
    // =============================================================================

    And based on the example url, you need to set the logo and navbar as stacked and not inline. You can change this setting in Appearance > Customize > Header > Logo And Navigation.

    Hope this helps.