Notifications
Clear all

[Solved] Original WP embed function for YouTube?

38 Posts
18 Users
8 Reactions
22 K Views
Posts: 1602
(@anonymous20)
Noble Member
Joined: 9 years ago

Can somebody help me on this, since it doesn't seem to work.

The links posted are youtu.be and not youtube.com. Also only one change is needed in theme's functions ?

It is not clear to me.

Thanks

Robert
Posts: 10587
Admin
(@robert)
Support Team
Joined: 9 years ago

@anonymous20, I just updated the code again, please remove the old version and use this one:

https://wpforo.com/community/general-discussions/original-wp-embed-function-for-youtube/#post-1875

Posts: 1602
(@anonymous20)
Noble Member
Joined: 9 years ago
Posted by: Robert

@anonymous20, I just updated the code again, please remove the old version and use this one:

https://wpforo.com/community/general-discussions/original-wp-embed-function-for-youtube/#post-1875

Thanks i will. Only this code is needed in theme's functions ? Nothing else to change ?

 

 

Robert
Posts: 10587
Admin
(@robert)
Support Team
Joined: 9 years ago

Thanks i will. Only this code is needed in theme's functions ? Nothing else to change ?

Yes, only in WordPress active theme's functions.php file.

Posts: 1
(@cassieve)
New Member
Joined: 6 years ago

Hi there,

I've been trying to get the original embed function to work but it won't work for some reason. After I put the embed code of the videos (whether its Youtube or Vimeo) on the source code box the video is displayed on the reply preview but after I submit it the video player doesn't show up on the posted reply :/ I also tested with social media embeds such as tweets and Instagram posts and those work (although the Instagram post won't actually show up the image and just a white box)...

So I tried adding that code to the current theme's functions but I get this error after I try to update the file:

Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP.

Thanks in advance for your help!

Page 4 / 5