Support » Theme: OnePress » Hyperlinks getting changed on frontpage

  • Hi. I am trying to use links click to call and click to text on frontpage but stuck with this problem:

    these links normally work
    example:
    tel:+44-7440-xxxxxx
    sms:+44-7440-xxxxxx

    however when I use them in hero section on front page theme change them to
    example:
    mywebsitedomainname.com/+44-7440-xxxxxx

    please see the live example

    would you know how to fix this please?

    • This topic was modified 1 month, 2 weeks ago by fr4nk2.
    • This topic was modified 1 month, 2 weeks ago by fr4nk2.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Hi @fr4nk2

    I’m sorry for the late reply.

    By default, the link tel:+1234567, still works well but the link sms:+1234567 does not support on the front page.

    Please try to use this code on the option small text

    <a class="sms-link" href="#">Send an sms</a>

    then put this code to the file functions.php to show the link SMS without mywebsitedomainname.com/+44-7440-xxxxxx

    function force_sms_link(){
    ?>
     <script>
    jQuery(window).load(function(){
    jQuery('a.sms-link').attr('href','sms:+44-7440-xxxxxx');
    });
     </script>
    <?php
    }
    add_action('wp_footer', 'force_sms_link');

    Regards.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.