• Resolved bosh

    (@bosh)


    I am trying to sort out the tel: link feature in the theme header. I am running a child theme of bidnis but am not doing very much at all and am not editing the header. It should work, I have no clue why it is adding the https:// to the phone number link. See example:
    <a href="https://tel:5354636345345">5354636345345</a>

    FYI if I add a telephone number to body text and add a link to it, it works no problem. See below for correct code if phone number link is added to body text .
    <a href="tel:5354636345345">5354636345345</a>

    • This topic was modified 7 years, 8 months ago by bosh.
Viewing 1 replies (of 1 total)
  • Thread Starter bosh

    (@bosh)

    update:

    As it seems impossible to override the function, I have edited the core theme file, (theme_functions.php, in the ‘inc’ folder) as follows:
    <a class="bidnis-phone" href="<?php echo esc_url ( 'tel:' . get_theme_mod('phone') ); ?>">

    It was originally:
    <a class="bidnis-phone" href="tel:<?php echo esc_url( get_theme_mod('phone') ); ?>">

    (The original code returned a prepended https:// thereby breaking the link). I hate editing core theme files, but it seems the only way to sort it out.

    • This reply was modified 7 years, 8 months ago by bosh.
    • This reply was modified 7 years, 8 months ago by bosh.
Viewing 1 replies (of 1 total)
  • The topic ‘esc_url is prepending https:// in phone number link’ is closed to new replies.