The initial Setup
1/ Add the following to your functions.php file. (you can customize the function name)
2/ Add the following to your style.css file.
How to use the shortcode in WordPress
In the visual editor, when you want to add a Youtube Video, use the following shortcode
Where BK6pKsEq4FA is the reference of the Youtube Video (for example in https://www.youtube.com/watch?v=BK6pKsEq4FA )
The live example
For the following video, we use: