Hot answers tagged

11 votes
Accepted

How can I clear oEmbed caches for YouTube on posts as they are loaded

How to trigger an oembed cache regeneration The default cache time is 24 hours and we can adjust it with the oembed_ttl filter. But as you've noticed, expired cache is not enough to trigger a cache ...
birgire's user avatar
  • 66.7k
5 votes
Accepted

Why isn't this youtube shortcode working?

I think this is what you are looking for: <?php echo wp_oembed_get('https://www.youtube.com/watch?v=vZBCTc9zHtI'); ?> For more details check this documentation.
Rituparna sonowal's user avatar
3 votes

Preventing YouTube embeds loading multiple instances of player JS?

In theory youtube embedding is done as iframes, and iframe are virtual additional independent web pages which are rendered at the same window, therefor the content of one iframe can not gave an impact ...
Mark Kaplun's user avatar
  • 23.2k
3 votes
Accepted

How to change thumbnail of embedded Youtube video?

The [video] shortcode can be used with the src being an URL of a youtube video. To set a placeholder, preview thumbnail use poster, it even works nicely via GUI. In the end it should look somewhat ...
Nicolai Grossherr's user avatar
3 votes

WordPress, oEmbed & YouTube video's with a 'dash'

Turns out the YouTube video in question had Embedding disabled by request. Tested with other YouTube videos with a 'dash' and they work fine (if embedding is not disabled).
David Clough's user avatar
3 votes
Accepted

Is it possible to enqueue the Youtube API script or does it have to be inline?

First, make sure the YT api is enqueued() and added to the footer. function wp_enqueue_scripts__youtube_api() { wp_enqueue_script( 'yt-player-api', 'http://www.youtube.com/player_api', array(), ...
jgraup's user avatar
  • 9,699
3 votes
Accepted

Wordpress block editor embeds not working in theme (single.php)

That would be because they're using oEmbed, not a shortcode. You should use the function the_content() to render the content of a post, as it applies all the things required to make embeds, shortcodes,...
cameronjonesweb's user avatar
2 votes
Accepted

Manipulating oembed_dataparse stopped working for YouTube embeds

I think I solved by doing this: add_filter('oembed_dataparse', 'bolster_oembed_filter', 0, 2 ); I changed the priority of the add_filter statement to 0, now it works again.
Florian's user avatar
  • 1,575
2 votes

Youtube - Embed as IFRAME

If you don't want to utilize the latest oembed functions and want the old iframe way from any page or post, you can do these: Get the embed code from any youtube video. While editing/creating your ...
Carl Alberto's user avatar
  • 1,067
2 votes

WordPress Editor not getting youtube video preview

Had this same issue, but figured it out once I dug around in WordPress a bit. What you need to do to make this work in a frontend tinyMCE editor is make sure you enqueue this JS file: add_action( '...
mauteri's user avatar
  • 121
2 votes

Video Embed with Captions in Turkish

Okay the thing is that the oembed endpoint seems not to support any other than the default parameters. So it seems that all you can do is parse the response and add in your parameters to the iframe ...
kraftner's user avatar
  • 5,598
2 votes

Why isn't this youtube shortcode working?

If you just want to embed a video in the content area, WordPress does this pretty elegantly with oembeds. You just need to paste the URL into the editor and save the post. As long as the embeds are ...
Dave Romsey's user avatar
  • 17.6k
2 votes

Remove Title of youtube video

This works, the OP code was odd and I've never seen that usage before or the other filter. Tested and works. This code removes Title on youtube but doesn't touch anything else since the parameters ...
Christina's user avatar
  • 463
2 votes

YouTube embed parameters?

There's always a filter you can use to hook into the output, see embed_oembed_html. Try this in a custom plugin or child theme's functions file, it will add any other query strings to the iframe src ...
Ismail's user avatar
  • 1,926
2 votes

How to make an embeded a Youtube video from custom field text responsive to screen size?

Welcome to WordPress StackExchange. This is really an HTML/CSS question rather than a WordPress specific one, so you will have better luck getting a quick answer in the future by posting to another ...
tmdesigned's user avatar
  • 1,655
2 votes
Accepted

WordPress 5.3.x YouTube oEmbed is not working

So apparently the issue also happens in WordPress 5.6 (the latest release as of writing), and YouTube is probably at fault because the (oEmbed) <link> tags are in the body instead of the head (...
Sally CJ's user avatar
  • 37.7k
1 vote
Accepted

YouTube API 403 error when website restriction set

If you restrict the application (or API key) by HTTP referrers, then your remote HTTP request should include a valid HTTP_REFERER header, which wp_remote_get() does not set by default. And you can set ...
Sally CJ's user avatar
  • 37.7k
1 vote
Accepted

Modify YouTube Embed Code to fit theme

If you're using the block editor, the fix is simple: add_theme_support( 'responsive-embeds' ); You can also make the iframe responsive using pure CSS, just wrap it in a div: <div class="yt-...
Tom J Nowell's user avatar
  • 58.2k
1 vote
Accepted

Embed youtube list with sidemenu opened

This isn't possible, youtube doesn't provide an embed with an open playlist. If it did, this isn't something that could be resolved from the WordPress end, as it's a Youtube OEmbed issue. You will ...
Tom J Nowell's user avatar
  • 58.2k
1 vote

Getting youtube links from post_content not working

Ok here is working code: function get_yts() { $query_args = array( 's' => 'youtube.com/watch?v=', ); $posts = get_posts( $query_args ); foreach ($posts as $p) { $input_line = $p-&...
FrancMo's user avatar
  • 153
1 vote
Accepted

How to edit embed filter for youtube video to allow responsive full width layout

Thanks to Serkan's suggestion I was pointed in the right direction to search for editing the wrapper rather than filtering the video itself (even though I would have loved a "filter only" solution.) ...
Mr.Brown's user avatar
  • 1,015
1 vote

Wordpress site in China times out on requests to youtube

The Youtube is called by a script named "jquery.st.youtube.js" which is located in your themes folder. You seem to use a premium theme named "Wunder" which effectively means you can do one of two ...
HU is Sebastian's user avatar
1 vote
Accepted

I'm having a problem viewing the Youtube video

You should use the_content function to process embeds. Another way is to apply the_content filter. apply_filters( 'the_content', $post->post_content' );
Anton Lukin's user avatar
1 vote

YouTube embeded video will not resize (only full screen responsive)

There is a check box in the Headway backend. Unticked it - and it worked. Embedded youtube video will now resize with iframe size code. Thanks Dave Romsey
user122739's user avatar
1 vote
Accepted

Why is my get_post_meta not properly calling the custom field when attempting to embed a YouTube video?

By default get_post_meta returns an array. If you wish to return a single value you need to set the 3rd parameter to true. Eg. get_post_meta(93, 'youtubeId', true); And did you know that your ...
ngearing's user avatar
  • 2,134
1 vote

Why isn't this youtube shortcode working?

do_shortcode() Is used to printout shortcode. And you are writting URL in it. No use of this. Try to implement wp_oembed_get( $url, $args ) This will work for you. So your code will wp_oembed_get(...
gsjha's user avatar
  • 53
1 vote

Embed Youtube video link in wordpress editor

Try just pasting the YouTube URL in to the post or page in the text editor with-out embed code as an editor. See if that works never heard anyone having this problem... https://www.youtube.com/watch?...
chop62's user avatar
  • 171
1 vote

Preventing YouTube embeds loading multiple instances of player JS?

Google I/O 2011: YouTube's iframe Player: The Future of Embedding will tell you all about the past's future. You might be able to find an alternative on to iFrame on the YouTube Developer section but ...
jgraup's user avatar
  • 9,699
1 vote

Iframes inside bootstrap tab disappear when tab is shown

Your problem is not within your control. iframes are not your site (at least when embedding content from outside sources). The content there is under the control of some other developer. Then you have ...
kaiser's user avatar
  • 50.5k
1 vote

pass user id in slug and get user information

The code seems incomplete. Maybe the problem is simply that you define $id but then try to use $user_id? Also, I think id is a protected variable, so maybe use my_id instead. Try this: www.mysite....
Johano Fierra's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible