Skip Navigation

[Waiting for user feedback] I am trying to use shortcodes to dynamicly show a clickable phone number.

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.

This topic contains 1 reply, has 1 voice.

Last updated by Christopher Amirian 14 hours, 52 minutes ago.

Assisted by: Christopher Amirian.

Author
Posts
#2827098

I am trying to:
I have a page with many properties. Eeach property has a different contact person. I have set up post relationship where the contact person is the parent and the property is the child. I am trying to output the contact persons numbers and also make it clickable so people on smartphones can call it with ease. But i can not get this to work.
I am using the following line: [types field='tlf-nr' item='@megler-naeringseiendom.parent'][/types]

Link to a page where the issue can be seen:
hidden link

I expected to see:
A phone number that can be clicked and called. In the console i expected to see 91569453

Instead, I got:
Instead i see 91569453

#2827103

Christopher Amirian
Supporter

Languages: English (English )

Hi,

Welcome to Toolset support. I think you’re already pulling the parent’s field correctly:

You're already pulling the parent's field correctly:

That prints the number as plain text. To make it “tap-to-call”, wrap the raw value in a tel: link, and show the pretty value as the link text:

<a href="tel:[types field='tlf-nr' item='@megler-naeringseiendom.parent' output='raw'][/types]">
  [types field='tlf-nr' item='@megler-naeringseiendom.parent'][/types]
</a>

Use output='raw' inside the href so the number has no extra HTML/formatting.

Thanks.