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’ );
Use the property current_post of a WP_Query object – it’ll be zero for the first post: if ( $wp_query->current_post === 0 ) // First post in main loop if ( $get_videos->current_post === 0 ) // First video in current videos loop
Apparently only using the youtube URL in the SiteOrigin Editor is enough: https://www.youtube.com/embed/8D0pwUeody4 https://siteorigin.com/thread/youtube-video-not-displaying-on-smartphone/#comment-86750 That being said, this means you can’t configure anything on the youtube container (width, height, allowing fullscreen, etc.)
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 client can just paste a youtube URL into the WordPress editor and it will auto-embed that video? get_post_meta
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
You should use the_content function to process embeds. Another way is to apply the_content filter. apply_filters( ‘the_content’, $post->post_content’ );
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.) Nonetheless, I stumbled upon a easy solution here – https://millionclues.com/wordpress-tips/fullwidth-responsive-youtube-embeds/ … I hope this can assist someone else with the same issue … Read more
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-container”> </div> .yt-container { position:relative; padding-bottom:56.25%; padding-top:30px; height:0; overflow:hidden; } .yt-container iframe, .yt-container object, .yt-container embed { position:absolute; top:0; left:0; width:100%; height:100%; } This article … Read more
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 the header using the headers argument like so where the array key is referer (note that it’s not double “r” as in … Read more
edit tag.php (or archive.php if tag.php does not exist) and look for the_excerpt(); – exchange it with the_content(); codex the_excerpt() codex the_content()
Youtube now supports oEmbed by default as the first option and even automatically highlights the url. Go to the youtube video you want, click share, the url is auto highlighted for you, copy + paste into wordpress, it does not get any easier.