Contact info widget links aren't working


#1

We’re using the ‘contact info widget’ on several pages. It now makes e-mail addresses and phone numbers clickable by itself, however, they aren’t working properly.

E-mail example:

http://name@domain.com instead of mailto:name@domain.com

Phone example:

tel:http://000000000 should be 0000000000


#2

Hello,

To fix this issue, you need copy the folder jupiter/components/shortcodes/mk_contact_info to the child theme https://themes.artbees.net/docs/installing-theme-and-child-theme/ with the same directory structure jupiter-child/components/shortcodes/mk_contact_info and edit the file mk_contact_info.php

Change line 37:

<li><i><?php Mk_SVG_Icons::get_svg_icon_by_class_name( true, 'mk-icon-envelope', 16 ); ?></i><span itemprop="email"><a itemprop="email" href="mailto:<?php echo esc_url($email); ?>"><?php echo $email; ?></a></span></li>

with this code:

<li><i><?php Mk_SVG_Icons::get_svg_icon_by_class_name( true, 'mk-icon-envelope', 16 ); ?></i><span itemprop="email"><a itemprop="email" href="mailto:<?php echo $email; ?>"><?php echo $email; ?></a></span></li>

Best regards,
Artbees Support.


#3

Thanks that did the trick :slight_smile:


#4

You’re welcome.

Best regards,
Artbees Support.


#5

Sorry… same issue but I’m a little confused. Do I need to copy the folder to somewhere or just change the mk_contact_info.php file?


#6

Hello @Joshua_Fritz,

You need copy the folder “mk_contact_info” to the child theme.
How to create a child theme you can read here:

Then copy the folder jupiter/components/shortcodes/mk_contact_info to the child theme with the same directory structure jupiter-child/components/shortcodes/mk_contact_info and edit the file mk_contact_info.php in this directory jupiter-child/components/shortcodes/mk_contact_info (it is required to make changes in the child theme so you don’t lose them after theme update).

Change line 37:

<li><i><?php Mk_SVG_Icons::get_svg_icon_by_class_name( true, 'mk-icon-envelope', 16 ); ?></i><span itemprop="email"><a itemprop="email" href="mailto:<?php echo esc_url($email); ?>"><?php echo $email; ?></a></span></li>

with this code:

<li><i><?php Mk_SVG_Icons::get_svg_icon_by_class_name( true, 'mk-icon-envelope', 16 ); ?></i><span itemprop="email"><a itemprop="email" href="mailto:<?php echo $email; ?>"><?php echo $email; ?></a></span></li>

Thank you.
Best regards,
Artbees Support.


#7

Good evening, I also have the same problem, for the mail I solved but for the phone number how can I delete “http” before the numbers?
Last question, which theme should remain active? jupiter or jupiter child theme?
Thank you very much
Nicolò


#8

Hello,

You need edit the same file in the child theme jupiter-child/components/shortcodes/mk_contact_info and edit the file mk_contact_info.php and replace the line 32:

<li><i><?php Mk_SVG_Icons::get_svg_icon_by_class_name( true, 'mk-icon-phone', 16 ); ?></i><span><a itemprop="telephone" href="tel:<?php echo esc_url( $phone ); ?>"><?php echo $phone; ?></a></span></li>

with this code:

<li><i><?php Mk_SVG_Icons::get_svg_icon_by_class_name( true, 'mk-icon-phone', 16 ); ?></i><span><a itemprop="telephone" href="tel:<?php echo $phone ; ?>"><?php echo $phone; ?></a></span></li>

If the changes are made in the child theme, then you should activate child theme.

Best regards,
Artbees Support.


#9

Hi! wondering if it possible to change it at the original theme… without making a child theme.
Or is this the only solution, through the childtheme? I’m afraid it will mess up the rest of the site…


#10

I actually did install the child theme… but the problem remains: mailto:
opens mail app to: http://info@email.com


#11

This is a bug as the function esc_url should not be used on email addresses. It will always add “http://”. This said the bug should be fixed in the theme itself.


#12

Hello,

Did you install the child theme and make the changes in the file as described in the post above?
Could you please create a ticket https://themes.artbees.net/new-ticket and provide FTP/WP Dashboard credentials to check the issue?

Best regards,
Artbees Support.