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’ );
declaring max-width: 100%; works for me. it looks like the selector in your example code is incorrect. try: .commentlist iframe { max-width: 100%; }
This might help. On the YouTube video page, choose Share, then choose Embed, then choose Show More. Remove checks in boxes for “Show Player controls” and “Show Video Title and Player Actions.” Choose largest given width size or custom size that is equal to or slightly greater than your div container width. Copy the code. … Read more
An alternative would be to use WordPress’s build in auto embed, the following line in core is responsible for auto embed: add_filter( ‘the_content’, array(&$this, ‘autoembed’), 8 ); Which means: Whenever we are about to display content try to auto embed all url’s with a priority of 8. You could add a custom filter before this … Read more
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