Insert YouTube videos in posts and sidebar without using any extra plugin which means an increase in your site load time. Plugins do increases site load time, it is always advised not to install too many plugins instead install a few which are more important for your blog.
A plugin does the things very easily, so it is preferred plugins over codes.
But this simple code doesn’t require an Einstien brain. A simple code [[youtube]] this all you need to remember.
Now, let’s practically show to you. We are going to embed most popular YouTube video Despacito by Luis Fonsi ft. Daddy Yankee
Open Visual editor and type the following code—[[youtube https://www.youtube.com/watch?v=kJQP7kiw5Fk ]]
If you want to resize its width and height, you need a slight modification to the code—[[youtube https://www.youtube.com/watch?v=kJQP7kiw5Fk&w=420&h=300]]
Where w stands for width and h stands for height.
That’s it simple and easy method with a shortcode.
Note: It may not work with all themes, in most cases all new themes come with this shortcode. Do check it in theme function.php
Now, enjoy the video—[youtube https://www.youtube.com/watch?v=kJQP7kiw5Fk ]
An adventurous mind with a good knowledge of WordPress. Loves to talk about technology. He spends most of his time on his PC playing video games.
The Ultimate List Of The Best SEO Keyword Rank Checkers
5 Reasons Why I Hate the New WordPress Editor Gutenberg
WordPress.com vs WordPress.org | Which one is better?
How much does Mediavine Pay?
How to add ads.txt file on WordPress and Blogspot?