I’ve found a number of posts in the Enfold forum about disabling related videos on YouTube videos. None of them solved my issue. In the end, I had to hack /enfold/js/aviapopup/jquery.magnific-popup.min.js and change
src:"//www.youtube.com/embed/%id%?autoplay=1
to
src:"//www.youtube.com/embed/%id%?autoplay=1&rel=0
Is this really the only solution? Is there any way to do this without having to hack a core Enfold file? I’m concerned about the long term viability of doing this.
Hi Kevin!
Have you tried using this plugin – https://wordpress.org/plugins/hide-youtube-related-videos/ ?
Best regards,
Yigit
Yes. That did nothing. It only works with videos that are embedded using oEmbed. Not with ones that are linked to from images. See the video player image on the front page of the site in Private Content. It’s working now but only because I hacked the file.
Thanks for your quick reply!
Hey!
Please use a child theme – http://kriesi.at/documentation/enfold/using-a-child-theme/ and then move modified file into /js/aviapopup folder. Then add following code to Functions.php file of your child theme
function wp_change_popupjs() {
wp_dequeue_script( 'avia-popup' );
wp_enqueue_script( 'avia-popup-child', get_stylesheet_directory_uri().'/js/aviapopup/jquery.magnific-popup.min.js', array('jquery'), 2, true );
}
add_action( 'wp_print_scripts', 'wp_change_popupjs', 100 );
Cheers!
Yigit
I’ll give this a shot. There’s no way to override the magnific settings? I really don’t want to disconnect anything from the theme update process.
Hi!
I am afraid there is no other way, no.
What Yigit suggests with a child theme will not brake your theme at all at any update.
Best regards,
Basilis
Okay. Thanks. FYI, I tried this solution and it worked like a charm.
Thanks!