I am trying to embed a video on my homepage. I add the embed code from YouTube and paste it into a custom html blog on the gutenberg editor. I click update and check my website and the video is there. I refresh the page and the video disappears. I go to the page editor and the embedded code for the video has been removed. Please can someone tell me why this is happening? I have tried to research it …
i want to show youtube user's comment section profile pic in my wordpress comment section As i am fetching youtube video along with its commnets but i couldn't show user's profile image in my comment section in my blog comment i fetched with profile pic in blog comment section its showing blank or default image gravatar url i got for author https://yt3.ggpht.com/ytc/AKedOLRFowb1wyXwkxTIi3UgCrpJlBxZJuP4WLA9vK6f=s48-c-k-c0x00ffffff-no-rj|
How can i add : class="youtube-player" type="text/html" to iframe like : function Oembed_youtube_no_title($html,$url,$args){ $url_string = parse_url($url, PHP_URL_QUERY); parse_str($url_string, $id); if (isset($id['v'])) { return '<iframe class="youtube-player" type="text/html" src="https://www.youtube.com/embed/' .$id['v'].'?vq=large&autohide=1&autoplay=1&fs=1&hl=fr&rel=0&loop=1" frameborder="0" allowfullscreen></iframe>'; } return $html; }
Is there a way to search all posts and pages in my WordPress site and find those who have a Youtube video embedded in them? The reason to do that is I want to disable the wp-embed.min.js but before doing that, I need to confirm there are no posts or pages that embed Youtube videos. Update I create a test post and embed a Youtube video in it, and then check the HTML source, and find the following one: <div …
When I embed a Youtube video onto my page, is there a way to change the thumbnail displayed (screenshot)? I do not have admin access to the Youtube video in-question. I would prefer a non-plugin solution if possible. I found these instructions, but they did not work.
I am trying to embed 'spotify' and 'youtube' services in the block editor. When added from the admin, they are displayed fine in the block editor, but when the post content is printed from the theme (single.php), only the respective urls are printed. The rendered HTML looks like: For Spotify: <figure class="wp-block-embed is-type-rich is-provider-spotify wp-block-embed-spotify wp-embed-aspect-21-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper"> https://open.spotify.com/episode/xxxxxx&amp;dl_branch=1 </div></figure> For Youtube: <figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-4-3 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper"> https://www.youtube.com/watch?v=xxxxxx </div></figure> In single.php, I'm obtaining the post content through …
My developer created custom theme for WP, and for some reason Wordpress fails to embed video URL on user-end. Everything is fine with Default WP themes, also video is fine on visual mode, but if I try to switch to this theme- I see only the video URL, but not embed video. Looks like we need to add something to our theme, but can't find any manual - what we need to add to function.php? thanks
First of all, let me mention that I have already looked at the following two similar questions: Is it possible to modify the default YouTube embed attributes string? Filter oembeds tags to modify iframe attributes But both of them are pre Gutenberg era. So, while using Gutenberg oEmbed block to embed a YouTube video if I want to add a srcdoc attribute to it, is there a way to do it? Or do I have to create my custom block …
We followed Brian Fegter's answer to display YouTube videos using WordPress' oEmbed feature: // Public video. $video_url = 'https://www.youtube.com/watch?v=1lODe0i7dNw'; require_once(ABSPATH . 'wp-includes/class-wp-oembed.php'); $oembed = new WP_oEmbed; // Auto-detect the video provider with the following $provider = $oembed->discover($video_url); $video = $oembed->fetch($provider, $video_url); echo $video->html; The code worked earlier. But right now it's not working. We're using WordPress 5.3.2. We tried updating WordPress to 5.3.6, but no luck. The main issue is: $oEmbed->discover() cannot detect any provider and returning false. :( You …
When you´re embed a youtube video in an iframe, you can enable the privacy-enhanced mode, so YouTube doesn´t store information about your web page visitors until they play the video. I've tried to embed a video via oEmbed and the URL http://www.youtube-nocookie.com/embed/xA3tfBTvH0c but it didn't work. Is there a chance to implement a privacy-friendly solution with oEmbed? EDIT I found this proposal and tried to customize it and it seems to work, but there is one thing that is not …
I would like to embed a YouTube video on my category description pages. When I pasted the URL or embed code in the editor, I see the video. But on the page itself it just shows the code. Is there a way to enable YouTube embedding for category (taxonomy) pages?
I know of 3 ways to embed a YouTube video inside Gutenberg Just pasting the Embed code inside an HTML Block Just pasting the video URL Using the YouTube Block While method #1 seems to work without a problem, I cannot seem to be able to make the others work. I keep getting the message "Sorry, this content could not be embedded". I thought this might be a bug, so I updated to latest version, (5.5.1 at the time I …
Even if users disable the popular Lazy Load for Videos plugin and the frontend correctly resets videos so that videos are no longer lazy-loaded, the Gutenberg block does not get reset. Below screenshot shows how the iframe still includes the HTML of the deactivated plugin: I cleared my browser cache and cookies, I ensured the oembed metadata caches are emptied, and I tried to clear more caches using commands from How can I clear oEmbed caches for YouTube on posts …
I am loading the latest videos from a YouTube channel to WordPress, using the YouTube API: function load_feed() { $url = add_query_arg( array( 'part' => 'snippet', 'channelId' => '[YouTube channel ID]', 'maxResults' => 3, 'order' => 'date', 'type' => 'video', 'key' => '[YouTube API key]' ), 'https://www.googleapis.com/youtube/v3/search' ); $response = wp_remote_get(esc_url_raw($url)); return json_decode(wp_remote_retrieve_body($response), true); } Everything works well when in the API settings on Google Developers I have: Application restrictions: None But when I set: Application restrictions: HTTP referrers (web …
I tried $videoID = wp_oembed_get( get_post_meta( get_the_ID(), 'video_url', true ) ); but that doesn't seem to do anything. I'm trying to set playlist id as the video id so the video loops itself. function imp_custom_youtube_querystring( $html ) { if(strpos($html, 'youtube')!= FALSE) { $args = [ 'rel' => 0, 'showinfo' => 0, 'modestbranding' => 1, 'loop' => 1, ]; $videoID = wp_oembed_get( get_post_meta( get_the_ID(), 'video_url', true ) ); $params = '?version=3&#038;playlist='.$videoID.'&#038;'; foreach($args as $arg => $value){ $params .= $arg; $params .= …
I'm using a custom bootstrap template and other users will be embedding youtube videos, which I want to be responsive to fit the theme. What can I do to make the normal YouTube embed code, something like this: <iframe width="560" height="315" src="https://www.youtube.com/embed/2jna3dWEnzo" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> Into this formatting (simplified and with class added): <iframe class="embed-responsive-item" src="https://www.youtube.com/embed/2jna3dWEnzo" allowfullscreen></iframe> Any help would be fab!
I am using a YouTube embed on my site. To make it autoplay I have added ?autoplay=1 to the embed too. The code when added to the page/post editor, is showing the video with autoplay. But on the front end, the video is not playing automatically. Is there any possible reason for that? Here is the code I am using: <iframe width="460" height="220" src="https://www.youtube.com/embed/rUWxSEwctFU?autoplay=1&controls=0&loop=1&playlist=rUWxSEwctFU&amp;showinfo=0" frameborder="0" allowfullscreen allow="autoplay"></iframe> Can anyone please let me know what I am doing wrong here? Thank …
I'm an editor in a wordpress blog I have embedded an youtube list with this code: [youtube https://www.youtube.com/watch?v=*********&list=**************************] I want that the plalist has the sidemenu opened by defalut. How can I achieve that?
In Wordpress 4.0, if I create a new post and paste a YouTube link directly into the post editor, Wordpress will automatically convert it to a YouTube embed tag. I'm trying to edit the default output for the embed tag with a filter function. I have a snippet set up like this: add_action( 'wp_embed_handler_youtube', 'bigger_youtube_embeds', 10, 4); function bigger_youtube_embeds($embed, $attr, $url, $rawattr) { // alter the $embed string... return $embed; } I tried this after viewing the following documentation: https://developer.wordpress.org/reference/hooks/wp_embed_handler_youtube/ …