Sauter la navigation

[Résolu] Shortcode to display a URL in a custom post field not working

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem: I am trying to use a custom URL field as the destination for an Elementor button element, but it's not working correctly.

Solution: In the Shortcode area, use the following syntax:

[types field='twitter-url' post_id='3679' output='raw'][/types]

Relevant Documentation:
https://toolset.com/documentation/customizing-sites-using-php/functions/

This support ticket is created Il y a 5 années et 1 mois. 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.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Ce sujet contient 4 réponses, a 2 voix.

Dernière mise à jour par barryG-4 Il y a 5 années et 1 mois.

Assisté par: Christian Cox.

Auteur
Publications
#1377397
Screenshot 2019-11-06 at 16.56.38.png
Screenshot 2019-11-06 at 16.55.26.png
Screenshot 2019-11-06 at 16.43.24.png

I am trying to:

I created a custom post field called 'twitter-url' in a custom post type called 'Site Details'. I Used Elementor to edit the page I want the info displayed on and I selected 'Shortcode' from the dynamic list and entered what I think is the correct shortcode for post id 3679 but there is no link showing on the public page.

The source code shows:



Twitter

but it should show:

lien caché" class="elementor-button-link elementor-button elementor-size-sm elementor-animation-float" role="button">
<span class="elementor-button-content-wrapper">
<span class="elementor-button-text">Twitter</span>
</span>

Link to a page where the issue can be seen: lien caché in the footer on the right (the word 'twitter').

This is the shortcode I entered:

[types field=‘twitter-url’ post_id=’3679’][/types]

The types filed is a URL and I'm attaching images of the settings. Can you please tell me why I cannot get this to work.

Many thanks,
Barry.

#1377423

Hi, I noticed that the quotation marks aren't quite right. Can you try this version instead?

[types field='twitter-url' post_id='3679'][/types]
#1377499
#1377505

I think you need the raw URL output instead of a full link tag. Try this alternate, which should produce the raw URL text without extra markup:

[types field='twitter-url' post_id='3679' output='raw'][/types]
#1377511

My issue is resolved now. Thank you!