Skip Navigation

[Resolved] Changing the YouTube video on each page by using a custom field

This support ticket is created 6 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.

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 3 replies, has 2 voices.

Last updated by Minesh 6 years, 5 months ago.

Assisted by: Minesh.

Author
Posts
#589223

Tell us what you are trying to do?
I have a YouTube video showing at the top of every page. I need to be able to change the videos on certain pages so have created a custom field where the URL can be entered. But I just can't get it to work on the page. I've created a theme so need to code it into that.

Is there any documentation that you are following?
I've followed various instructions on the wp-types forum and docs

Is there a similar example that we can see?
You can see what's displayed on the pages.

What is the link to your site?
hidden link

#589323

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - URL field is used to input URL and it will display the URL.
=> https://toolset.com/documentation/customizing-sites-using-php/functions/#url

If you would like display video - you can use the Types field type:

1) Embedded media
=> https://toolset.com/documentation/customizing-sites-using-php/functions/#embedded-media

OR

2) Video:
=> https://toolset.com/documentation/customizing-sites-using-php/functions/#video

Does above field help to display the video?

#590277

Hi Minesh

Thanks for your advice. No, I'm afraid changing the field type to either Embedded Media or Video makes no difference.

Am I right that this syntax should be used in the theme?

echo(types_render_field( 'youtube-video' ));

Cheers

Jon

#590434

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Yes - that's correct, for custom post fields you can use echo types_render_field('field-name');

More info:
https://toolset.com/documentation/customizing-sites-using-php/functions/#url
[Section: "More']

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.