Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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=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.

    #713254

    Hi Kevin!

    Have you tried using this plugin – https://wordpress.org/plugins/hide-youtube-related-videos/ ?

    Best regards,
    Yigit

    #713257

    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!

    #713269

    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

    #713685

    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.

    #713727

    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

    #713734

    Okay. Thanks. FYI, I tried this solution and it worked like a charm.

    Thanks!

    #713737

    Hey!

    Great! :)
    Let us know if you have any other questions or issues!

    Best regards,
    Yigit

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Disable YouTube related videos’ is closed to new replies.