Advertisement
brooklyndesignstudio

Disable Youtube Related Videos

Oct 14th, 2023
656
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 0.56 KB | Source Code | 0 0
  1. <!-- Single Page Code -->
  2. <script>
  3. jQuery(document).ready(function($ ) {
  4. // add '&rel=0' to end of all YouTube video URL's
  5. // to prevent displaying related videos
  6. $('.pa-hide-related-videos iframe').attr( "src", function( i, val ) {
  7. return val + '&rel=0';
  8. });
  9. });
  10. </script>
  11.  
  12. <!-- Global Code (Divi-Integrations-Head) -->
  13. <script>
  14. jQuery(document).ready(function($ ) {
  15. // add '&rel=0' to end of all YouTube video URL's
  16. // to prevent displaying related videos
  17. $('.et_pb_video iframe').attr( "src", function( i, val ) {
  18. return val + '&rel=0';
  19. });
  20. });
  21. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement