Adding Youtube videos to your WordPress site no longer present itself as a daunting task. Thanks to the Automatic Youtube Video Posts Plugin.

The plugin works by synchronising a category of your post list with videos on any Youtube channel. Based on your refresh interval settings, new video post are added to your category and can be made publicly available or saved as draft.

This plugin saves you time and energy having to manually embed your videos on your site, however upon installation, you will notice it wasn’t responsive for mobile viewing.

So here is how to solve the riddle.

First you need to add a CSS class to the category page of your WordPress site. It best you add this to the Functions.php file of your Child theme.
You may follow my example below:



if ( is_category('recipes') ) { ?> <div id="featured_recipe"> </div> <?php }

Afterwards, head to your custom CSS page, it could be your child theme Style-sheet  or rather still your Edit CSS page if you use Jetpack CSS extension.

Add this to your custom CSS

 

 

Voila, we are done. Your Youtube post should now be fully responsive.

Credits:
https://codex.wordpress.org/Function_Reference/post_class

How to make Youtube Videos Mobile Responsive in WordPress

WordPress Tricks: Add a div or other element to one specific page or page type