New Landing How can we help? Atelier Youtube Related Videos

Viewing 14 posts - 1 through 14 (of 14 total)
  • Posted in: Atelier
  • #260736
    mbewick
    Member
    Post count: 6

    Hi there.

    I’m using the Video Player Element on my site to showcase a few YouTube videos, but don’t want to display any related videos at the end of the clip. I’ve tried adding ?rel=0 at the end of the link but this does not seem to fix the problem.

    Is there a piece of code I can add to either loop the video to prevent this, or anything I can further add to prevent the related videos appearing in the player.

    Many thanks.

    Mark

    #260739
    David Martin – Support
    Moderator
    Post count: 20834

    Hi Mark, please first test this plugin:

    https://wordpress.org/plugins/hide-youtube-related-videos/

    Thanks.

    #260748
    mbewick
    Member
    Post count: 6

    Hi David

    Unfortunately that plugin does not work.

    Kind Regards

    Mark

    #260775
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please paste this code at functions.php of child theme.

    add_filter( 'sf_youtube_embed_params', 'sf_remove_rel' );
    
    function sf_remove_rel($param){
    $param = ;?showinfo=0&controls=1&modestbranding=1&rel=0';
    return $param;
    }

    Thanks
    Mohammad

    #260945
    mbewick
    Member
    Post count: 6
    This reply has been marked as private.
    #260947
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please remove my last code and use this new code:-

    add_filter( 'sf_youtube_embed_params', 'sf_remove_rel' );
    
    function sf_remove_rel($param){
    $param = '?showinfo=0&controls=1&modestbranding=1&rel=0';
    return $param;
    }

    Thanks
    Mohammad

    #262755
    Pothe
    Member
    Post count: 336

    Thanks for this. Very useful. You should add it as an option to the element. Often youtube videos are used as main content, so it can be bad to show related content which sends users away from the page.

    #262771
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Thanks Mohammad

    – Kyle

    #276806
    PeaceDog
    Member
    Post count: 3

    Hello, sorry to dig up a 2 month old thread but I am having this exact same issue. I have tried the various Functions.php mods floating around in other threads too as well as the Related Videos plugin but nothing works.

    URL is flexo.nz. Can provide admin credentials if needed.

    Look forward to hearing from you.

    Thanks
    Blair

    #276838
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please provide me specific page url with issue and login detail to check and resolve the issue.
    Thanks
    Mohammad

    #276848
    PeaceDog
    Member
    Post count: 3
    This reply has been marked as private.
    #276856
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    I managed to resolve the issue by this code:-

    add_filter( 'sf_youtube_embed_src_params', 'sf_remove_rel' );
    function sf_remove_rel($param){
    $param = '?showinfo=0&controls=1&modestbranding=1&rel=0';
    return $param;
    }

    Thanks
    Mohammad

    #276858
    PeaceDog
    Member
    Post count: 3

    Awesome thank you Mohammad.

    #276859
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Glad 🙂 to help you.
    Thanks
    Mohammad

Viewing 14 posts - 1 through 14 (of 14 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register