Now days youtube is a biggest video search and play engine. so gradually it is need to use youtube video in our wordpress post. for adding youtube video in your wordpress posts there are many plugins. also you can embed youtube video on your blogger blog or blogspot blog but today i am sharing some code which is very helpful for add youtube video to wordpress posts without any kinds of plugins. for this please follow some steps very carefully:
(Please backup your sites file and database before editing)
1. At first go to your wordpress sites dashboard.
2. Now select your theme which theme you want to edit.
3. Now open your themes 'functions.php' file.
4. Copy bellow code:
6. Now paste this code in your wordpress blog post.
For following this article you can add youtube video to wordpress posts and if you want to know more about wordpress and blogger or blogspot then you can visit my another article in this blog.
(Please backup your sites file and database before editing)
1. At first go to your wordpress sites dashboard.
2. Now select your theme which theme you want to edit.
3. Now open your themes 'functions.php' file.
4. Copy bellow code:
/*5. Now paste this code in 'functions.php' file and save and close it.
Shortcode to display youtube thumbnail on your wordpress blog.
Usage:
[youtube_thumb id="VIDEO_ID" img="0" align="left"]
VIDEO_ID= Youtube video id
img=0,1,2 or 3
align= left,right,center
*/
function wp_youtube_video_thumbnail($atts) {
extract(shortcode_atts(array(
'id' => '',
'img' => '0',
'align'=>'left'
), $atts));
$align_class='align'.$align;
return '<img src="http://img.youtube.com/vi/'.$id.'/'.$img.'.jpg" alt="" class="'.$align_class.'" />';
}
add_shortcode('youtube_thumb', 'wp_youtube_video_thumbnail');
6. Now paste this code in your wordpress blog post.
[youtube_thumb id="rNWeBVBqo2c" img="0" align="center"](Change 'rNWeBVBqo2c' with your video id)
For following this article you can add youtube video to wordpress posts and if you want to know more about wordpress and blogger or blogspot then you can visit my another article in this blog.
Yoast SEO is a WordPress plug-in designed to help you improve some of the most important on-page SEO factors–even if you aren’t experienced with Web development and SEO. This plug-in takes care of everything from setting up your meta titles and descriptions to creating a sitemap. Yoast even helps you tackle the more complex tasks like editing your robots.txt and .htaccess.
ReplyDeleteSome of the settings may seem a little complex if you’re new to SEO and WordPress, but Yoast created a complete tutorial to help you get everything set up. And the team at WPBeginner made this handy video to help you get set up quickly.
This is a great post and I read a way while back. It really helped me out.Thank you so much for this great article.
ReplyDeleteSEO Tool
wordpress tutorial