0

I am unable to successfully embed (certain) YouTube URLs into my theme in the back end, with the intention of having viewable video clips on the front end. Not sure if this a WordPress issue or an issue with the video URLs themselves. I am using Divi, but have confirmed the problem is the same with Gutenberg and the Twenty Twenty theme.

All videos in question play fine on YouTube itself.

If I choose a random trending video from YouTube, the embed works fine. If I use one of my client's videos, nothing shows up on the front end.

Example probem video from my client: https://www.youtube.com/watch?v=rLZhyfkgHvs

Example working video, a random video chosem from youTube: https://www.youtube.com/watch?v=B3MDJsggfDg

Any ideas what might be going on?

**EDIT: Note that the issue is only for client-created videos. Random YouTube videos embed and play fine.

1 Answer 1

0

I had recently similar issue with Divi and embedding videos. At the end I realized its because oEmbed issues in WordPress sites running on host with both IPv4 and IPv6 sites.

Either you can add this code to your functions.php to fix this:

add_action( 'http_api_curl', function( $curl_handle ) {
   curl_setopt( $curl_handle, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );
});

Or you can download the same solution as a plugin I made - the site is in Czech Language, but it will lead to downloading very simple plugin doing the same thing

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.