Add latest Youtube videos on main page [closed]

Thats more a youtube than a wordpress question. But you can write a simple shortcode function and add it to your site. // Add Shortcode function custom_youtubeapishortcode() { $playlistid = “XXXX”; $apikey = “XXXX”; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => “https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId=”.$playlistid.”&maxResults=1&key=”.$apikey.””, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => “”, CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION … Read more

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->post_content; $output_array = array(); preg_match(‘/http(?:s?):\/\/(?:www\.)?youtu(?:be\.com\/watch\?v=|\.be\/)([\w\-\_]*)(&(amp;)?[\w\?‌​=]*)?/’, $input_line, $output_array); print_r($output_array); } }

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 need to refer to Youtube documentation or their support channels

Link Youtube Channel In WordPress Site

Old anwser What you are trying to is to import all your videos from your YouTube channel to your WordPress blog. Unfortunately YouTube is not providing any public web service that will allow external servers to get the kind of data you want to import. I don’t think you will find any plugin capable to … Read more

Adding a wrapper to the youtube embed automatically?

Personally, I found the oembed_dataparse filter pretty fiddly to use; sometimes it worked, sometimes it didn’t; and when used in conjunction with custom TinyMCE instances, it seems as though the added wrapper was hard-baked into the content rather than added via the filter at output. I found the embed_oembed_html filter much more reliable and works … Read more

oEmbed youtube video aspect ratio

WordPress does a pretty good job of embedding videos at the correct aspect ratio. The width of the embedded video is based on the content width set in your theme’s functions.php file. Because of this it sounds as if there may be some styles applied to the iframe element in your theme changing it’s size. … Read more

YouTube oEmbed and privacy-enhanced mode

At the moment WordPress only recognises youtube.com/watch, youtube.com/playlist and youtu.be. However there is wp_oembed_add_provider; try something like wp_oembed_add_provider( ‘#http://(www\.)?youtube-nocookie\.com/embed.*#i’, ‘http://www.youtube-nocookie.com/oembed’, true ); (untested sorry). You could even overwrite the existing providers to redirect to -nocookie and then use the video shortcode as normal. And you can do this with add_filter(‘oembed_providers’, … ); too if you’d … Read more

How add class youtube and type/html to oembed code?

You can try this: add_filter( ’embed_oembed_html’, ‘custom_youtube_oembed’ ); function custom_youtube_oembed( $code ){ if( stripos( $code, ‘youtube.com’ ) !== FALSE && stripos( $code, ‘iframe’ ) !== FALSE ) $code = str_replace( ‘<iframe’, ‘<iframe class=”youtube-player” type=”text/html” ‘, $code ); return $code; } to target the YouTube oembed HTML output. When I embed this YouTube link (Kraftwerk) into … Read more