YouTube is one of the most popular names online. The video-sharing website has amassed more viewership than the largest TV networks found anywhere in the world, even on mobile devices. From research, it was discovered that over fifty percent of total views on YouTube come from cellular devices. That is an indication that you ought to enhance your WordPress websites for mobile devices, but likewise for the ability to consistent video scale across all devices.
When it comes to sharing video content, or missions of complementing stories with videos from YouTube, it is essential you make your WordPress blog compatible with efficient video integration so that the video is displayed equally well in all range of devices. A lot of times, you might be confronted with problems like videos being of different dimensions and hence showing differently for different people because they use different viewing device. All devices getting the right size is crucial.
Quite amazingly, WordPress comes fortified with a shortcode called “embed”. This should make WordPress webmasters and bloggers smile. The function of the embed function is to literally allow you embed any form of media from the internet without having any plugin or code script intercede on your behave. In simple term, what this means is that you can share the URL of your YouTube video and it will be automatically embedded into any WordPress page.
The concept is quite simple! Link to the video to be displayed on your page or post, and it will automatically appear. That’s just it. The only thing you might want to adjust is the video height and width, and you can do this using the embed code too. The code is:
[[ embed width=”400″ height=”225″]YouTube Video URL[/embed]]
As an example, we wish to embed a video from YouTube. After getting its URL, we can include it in the embed code and adjust its height to 200 and width to 450 no matter what its original height and width might be. The code will look like this:
The same video will be displayed when you load that particular page except the fact that its height and width will be different if you alter it. Moreover, since the embed code is universal across WordPress, you can add other tags such as code, blockquote, and other shortcode being used on your site. You can check our tutorial on How to Use Shortcode on WordPress here.
All WordPress did with the embed shortcode is simplify what YouTube already offer in the Share Embed feature. Each YouTube video has a tab beneath the video title that prompts you to Share, and there’s another tab that says “Embed” upon clicking the Share tab. You’ll be shown a bit of iframe code which you can copy/paste into your posts.
However, you need to click the More tab to reveal other options, particularly when you want to choose different video dimension. The exact same tab will enable you to choose other features, such as to video title, or display player control.
Using WordPress Widget
Another method of displaying videos from YouTube is with a widget. You can either include the WordPress embed shortcode or the embed code in the default WordPress Text widget or use any YouTube widget in case your WordPress theme comes with one.
YouTube WordPress Plugins
The default and easiest way of embedding videos from YouTube is quite simple enough for anyone with little or no programming skill to adapt to. However, sometimes you will be caught up in scenarios where you need a bit more customization options, along with other methods of fetching various sorts YouTube videos such as playlists. For that, you can find different YouTube plugins in WordPress repository.