I am trying to: show the label of the field / link the phone number
Link to a page where the issue can be seen: hidden link
I expected to see: label / linked phone number
Instead, I got: no label / just plain text
Here are the shortcodes i use (inside a text box):
[wpv-post-title]
[types field="position" show_name="true"][/types]
[types field="telefon" output="html" show_name="true"][/types]
[types field="mobil" show_name="true"][/types]
[types field="e-mail" show_name="true"][/types]
Hello,
I assume we are talking about a custom phone field created with Types plugin:
https://toolset.com/documentation/customizing-sites-using-php/functions/#phone
There isn't attribute "show_name" or "output", so you will need to add the field label manually, for example:
Telefon: [types field="telefon" output="html" show_name="true"][/types]
Hi, thanks for reply and help!
[wpv-if telefon="wpcf-telefon" evaluate="!empty($telefon)"]Telefon: [types field="telefon"][/types][/wpv-if]
The label doesn't work in this case... and also the spaces should be removed in the href (my client want's to display the phone number with spaces!).
Just found the problem...
if i save this line:
[wpv-if telefon="wpcf-telefon" evaluate="!empty($telefon)"]Telefon: [types field="telefon"][/types][/wpv-if]
it works. If i reopen the text field and save again, it changes the line to:
[wpv-if telefon="wpcf-telefon" evaluate="!empty($telefon)"]Telefon: [types field="telefon"][/types][/wpv-if]
Maybe a bug?
Still need to remove the spaces in href attribute...
Please try to use single quotes in the Types shortcode, like this:
<a href="tel:[types field='telefon'][/types]">Telefon: [types field="telefon"][/types]</a>
See the live demo here:
hidden link
user/pass: xgren/111111
Content template URL:
hidden link
Thank you for your fast and straight forward support! I suppose the problem with the spaces in the href attribute could not be solved?
Please elaborate the new question with more details:
I suppose the problem with the spaces in the href attribute could not be solved?
You can duplicate the same problem in above test site, thanks
The client wants to output the phone number in this format:
+43 5372 67892 (with spaces between country and area and phone number)
This results in a link like:
+43 5372 67892 (also with spaces in the href attribute)
As far as i know, there should be no spaces within the href attribute. It should look like:
+43 5372 67892 (no spaces in href / spaces in text)
Example: hidden link
There isn't such a feature to remove the space in phone field value.
I just test the URL in my android phone and Skype soft ware, it can be called without any problem, I don't think you need to remove the space.