Skip Navigation

[Resolved] Phone number display

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.

Our next available supporter will start replying to tickets in about 8.61 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Karachi (GMT+05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Waqar 9 months, 3 weeks ago.

Assisted by: Waqar.

Author
Posts
#2681096

What is the best way to display a phone number so it looks something like this? +1 555-555-5555

Also, is there a way to make it clickable on a smartphone?

#2681188

Hi,

To make the phone number value from a Toolset custom field, a clickable phone link, you can use its shortcode in the HTML link like this:
( ref: https://toolset.com/documentation/customizing-sites-using-php/functions/#phone )


<a href="tel:[types field='phone-number' output='raw'][/types]">[types field='phone-number' output='raw'][/types]</a>

Note: you'll replace 'phone-number' with the actual field's slug.

The Toolset's phone number type field doesn't apply any formatting restriction to the entered numbers, and the values are saved as entered, including the numbers, special characters like the '+' sign, and spaces.

If you'd like to apply a certain input masking to the front-end forms, you can use custom script libraries. Here are some useful guides on the topic:

hidden link
hidden link

regards,
Waqar

#2681437

Thanks!