-
AuthorPosts
-
November 16, 2016 at 10:56 pm #713247
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=1to
src:"//www.youtube.com/embed/%id%?autoplay=1&rel=0Is 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.
November 16, 2016 at 11:00 pm #713254Hi Kevin!
Have you tried using this plugin – https://wordpress.org/plugins/hide-youtube-related-videos/ ?
Best regards,
YigitNovember 16, 2016 at 11:05 pm #713257Yes. 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!
November 16, 2016 at 11:33 pm #713269Hey!
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!
YigitNovember 17, 2016 at 6:15 pm #713685I’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.
November 17, 2016 at 8:07 pm #713727Hi!
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,
BasilisNovember 17, 2016 at 8:31 pm #713734Okay. Thanks. FYI, I tried this solution and it worked like a charm.
Thanks!
November 17, 2016 at 8:54 pm #713737 -
AuthorPosts
- The topic ‘Disable YouTube related videos’ is closed to new replies.
