-
AuthorPosts
-
February 24, 2016 at 5:44 am #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?
February 25, 2016 at 1:44 pm #589045Hey rasa!
Please link it as following
<a href="sms:12345678">Send SMS</a>
Cheers!
YigitFebruary 25, 2016 at 8:30 pm #589436Okay, 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?
February 25, 2016 at 8:43 pm #589441Hey!
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,
YigitFebruary 25, 2016 at 9:40 pm #589469I’m guessing you mean “functions-enfold.php”
Where exactly should it go in the file?
February 25, 2016 at 9:40 pm #589470Hey!
No, “functions.php” file. It is right below “functions-enfold.php” file in Appearance > Editor. You can add the code to bottom.
Best regards,
YigitFebruary 25, 2016 at 9:51 pm #589474Ah, 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?
February 25, 2016 at 10:09 pm #589483Hey!
It will be overwritten. To avoid adding it again, please consider using a child theme :)
Regards,
YigitFebruary 25, 2016 at 11:02 pm #589508You are completely right about using a Child Theme!
Thanks again and again for your always fast and helpful answers!
-
AuthorPosts
- The topic ‘sms – text message – link in menu’ is closed to new replies.