Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #588135

    I have a phone number as a menu item, but I’d like visitors on a mobile phone to be able to click the number and send a text message. I tried putting “sms://+1413427xxxx” (but with the real number) in the URL box, but that doesn’t work. Is there a way to have our “TEXT US” menu item be clickable on a mobile phone?

    #589045

    Hey rasa!

    Please link it as following
    <a href="sms:12345678">Send SMS</a>

    Cheers!
    Yigit

    #589436

    Okay, this was stupid on my part and I apologize! I am currently building a new website for this client using Enfold, however still using the old theme (Kallyas) with their old site. I wanted to move away from Kallyas, but I’m still building the new Enfold version. But as for the sms issue, I will have the same issue on the new Enfold site, but it seems like this is a WordPress menu issue, and not so much theme related, HOWEVER, when I paste in the code you suggested into the URL field on the Menu page, I click Save Menu, and then when I open the menu item up again the code has disappeared. This happens on both the old Kallyas site and the new Enfold site. I click Save Menu and the URL code simply disappears. Any ideas? I’m thinking the URL field in the Menu section of the WordPress dashboard will only take a regular URL, and not an HTML code link. Is there some CSS workaround?

    #589441

    Hey!

    Please use # as URL and then add following code to Functions.php file in Appearance > Editor

    function avia_custom_element_id(){
    ?>
     <script>
    jQuery(window).load(function(){
    jQuery('#menu-item-2375 a').attr('href','sms:+370123123');
    });
     </script>
    <?php
    }
    add_action('wp_footer', 'avia_custom_element_id');

    Best regards,
    Yigit

    #589469

    I’m guessing you mean “functions-enfold.php”

    Where exactly should it go in the file?

    #589470

    Hey!

    No, “functions.php” file. It is right below “functions-enfold.php” file in Appearance > Editor. You can add the code to bottom.

    Best regards,
    Yigit

    #589474

    Ah, great. That works perfectly! Will this edit stay in the functions.php file when I next update the theme, or will I have to add it again?

    #589483

    Hey!

    It will be overwritten. To avoid adding it again, please consider using a child theme :)

    Regards,
    Yigit

    #589508

    You are completely right about using a Child Theme!

    Thanks again and again for your always fast and helpful answers!

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

The topic ‘sms – text message – link in menu’ is closed to new replies.