Skip Navigation

[Resolved] Youtube ID custom field added as shortcode in youtube hyperlink

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

Problem:

I inherited a website with about 2000 custom posts that have a custom field which output the youtube video ID. I have made the custom field managed by toolset and was hoping that the following will show the youtube video on the front-end but it is not working though the full url does show with the ID on the front-end.

Solution:

You can try with a shortcode block, display below codes:

https://toolset.com/forums/topic/youtube-id-custom-field-added-as-shortcode-in-youtube-hyperlink/#post-1730303

Relevant Documentation:

https://support.google.com/youtube/answer/171780?hl=en

https://wordpress.com/support/wordpress-editor/blocks/shortcode-block/

This support ticket is created 4 years, 5 months 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.

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/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by davidJ-4 4 years, 5 months ago.

Assisted by: Luo Yang.

Author
Posts
#1730089

I inherited a website with about 2000 custom posts that have a custom field which output the youtube video ID. I have made the custom field managed by toolset and was hoping that the following will show the youtube video on the front-end but it is not working though the full url does show with the ID on the front-end.

hidden link field='youtube_id' output='raw'][/types]

How can I make the Youtube ID custom field show as a video on front-end?

#1730303

Hello,

You can try with a shortcode block, display below codes:

<iframe width="560" height="315" src="<em><u>hidden link</u></em> field='youtube_id' output='raw'][/types]" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

Above those codes are copied from youtube video, "Share" button-> Embed Video

More help:
hidden link
hidden link

#1733539

My issue is resolved now. Thank you!