Skip Navigation

[Resolved] Shortcode to display a URL in a custom post field not working

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

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 5 years 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
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)

This topic contains 4 replies, has 2 voices.

Last updated by barryG-4 5 years ago.

Assisted by: Christian Cox.

Author
Posts
#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:

hidden link" 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: hidden link 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!