Skip Navigation

[Resolved] Make phone numbers clickable

This thread is resolved. Here is a description of the problem and solution.

Problem:
Make phone numbers clickable

Solution:
You can use the following code in order to make the phone number clickable:

<a href="tel:[types field='phone' output='raw'][/types]"><i class="fa fa-phone-square blue" aria-hidden="true"> [types field='phone'][/types]</i> </a>

You can find the proposed solution, in this case with the following reply:
=> https://toolset.com/forums/topic/make-phone-numbers-clickable/#post-1101618

Relevant Documentation:

This support ticket is created 6 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 4 replies, has 3 voices.

Last updated by stewartE 6 years, 2 months ago.

Assisted by: Minesh.

Author
Posts
#1101499
phone.PNG
listing.PNG

I have a custom content type called Sites with custom fields to display the location details of my offices with address, phone, number, email etc

One of the fields is a phone number (see attached) which is filled in and displayed on the front end as part of a listing using Views and you can click on each site in the listing to show the individual site page (using Content Templates)

I have had a request from marketing that these phone numbers need to be clickable on mobile. To do this I think I need to make the phone numbers into a clickable link? ( but if i try and add that html into the field itself it just shows on the front end. Is there a way to wrap the field in a tel link in the Content template?

When the field is filled in it would then automatically be in a link and the correct number would be automatically inserted in the link from what what is filled in to the field

Or is there another way to do this?

Thanks

#1101547

You would add the phone number to the Field, then insert the Field in your Post Body or Content Template using the HTML for clickable numbers:

<a href="tel:[types field='your_number_field'][/types]"</a>

Does that work?

#1101565
current.PNG
Capture.PNG

Hi Unfortunately that didn't seem to work

This is the code i used:

<i class="fa fa-phone-square blue" aria-hidden="true">

and this is what I saw on the front end where the phone number should be displayed (see screenshot)

(also added screenshot of current shortcode without added anchor link which is displaying the phone number fine)

Thanks!

#1101618

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - there is a little issue with the code shared by the Beda.

What if you try to use the following code:

 <a href="tel:[types field='phone' output='raw'][/types]"><i class="fa fa-phone-square blue" aria-hidden="true"> [types field='phone'][/types]</i> </a>
#1101695

That worked Thanks!