Add phone number to top right of page

Home Forums Forstron Add phone number to top right of page

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #15973

    Sean
    Member

    Add phone number to top right of page

    Resolved

    I am trying to add a phone number to the top right of the page where the social links menu is.

    I added text into the social links menu to try do it that way but nothing showed up.

    I was able to edit the theme’s base code in v1.4.3 to achieve what i wanted, but in the current version this is not possible. (I added some code to ‘menu-social.php’ which is a file that doesn’t exist in later versions of the theme).

    Can you please advise how i can achieve this?

    This is what i want to show up where the social icons are:
    <div align=”right”>Call Now:(02) 4332 1055</div>

    #15974

    Oliver Juhas
    Keymaster

    Hi,

    First, please note that div HTML tag does not have any “align” attribute. You should use a CSS for that. Either inline one or set a CSS class to your div and then style it in your custom CSS. https://www.w3schools.com/css/css_howto.asp

    Also, you should never edit theme core files as you will loose your changes when the theme updates. You should really use a child theme for theme modifications.

    The file dealing with social menu is now in templates/parts/component-menu-social.php. But better, more future proof solution than editing that file would be to add this code to your child theme‘s functions.php:

    function child_theme_phone() {
      echo '<div class="header-phone">YOUR_PHONE_HERE</div>';
    }
    add_action( 'wmhook_header', 'child_theme_phone', 40 );
    

    Please note that you will still need to apply your custom CSS styles (use the .header-phone class from the example above) to your needs and test the display on mobile devices.

    Regards,

    Oliver

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.