Skip to content

Instantly share code, notes, and snippets.

View dipakcg's full-sized avatar
🎯
Focusing

Dipak C. Gajjar dipakcg

🎯
Focusing
View GitHub Profile
This is the technique I use to defer Youtube videos, when optimising the performance of WordPress site.
(1) Replace Youtube iFrame embed code with the below one:
----------------------
<div class="dcg-responsive-container">
<iframe class="dcg-responsive-iframe" src="" data-src="https://www.youtube.com/watch?v=nEFZLFyZNcE?rel=0" frameborder="0" allowfullscreen style="border:0"></iframe>
</div>
(2) Add the following CSS element (stylesheet element that will make Youtube iFrame Responsive) (style.css?):