WordPress.org

Ready to get started?Download WordPress

Forums

Youtube Channel Gallery
[resolved] YouTube Channel Gallery - Don't Show Related Videos? (3 posts)

  1. kismetdesign
    Member
    Posted 2 years ago #

    I'm developing a site for a client that does not want their main video to show related videos (unless they belong to them) when it ends. I'm currently using the shortcode on a playlist/channel page.

    [Youtube_Channel_Gallery user="kofflerboats" maxitems="21" theme="dark" videowidth="800px" thumbwidth="190" thumbcolumns="3" link="1"]

    I tried putting rel="0" at the end, but no results. Any suggestions?

    KD

    http://wordpress.org/extend/plugins/youtube-channel-gallery/

  2. Brian KD
    Member
    Posted 2 years ago #

    We fixed this issue by consulting the youtube api:

    https://developers.google.com/youtube/player_parameters#rel

    And then editing line 224 of the youtube-channel-gallery.php file. Original Code:

    <iframe id="ytcplayer<?php echo $plugincount; ?>" class="ytcplayer" type="text/html" width="<?php echo $ytchag_video_width; ?>" height="<?php echo $ytchag_video_heigh; ?>" src="http://www.youtube.com/embed/<?php echo $youtubeid; ?>?&autoplay=0&theme=<?php echo $ytchag_theme; ?>&enablejsapi=1&origin=<?php echo site_url(); ?>" frameborder="0"></iframe>

    We added the &rel=0 parameter between these parameters: &autoplay=0&theme=

    For the final code of:

    <iframe id="ytcplayer<?php echo $plugincount; ?>" class="ytcplayer" type="text/html" width="<?php echo $ytchag_video_width; ?>" height="<?php echo $ytchag_video_heigh; ?>" src="http://www.youtube.com/embed/<?php echo $youtubeid; ?>?&autoplay=0&rel=0&theme=<?php echo $ytchag_theme; ?>&enablejsapi=1&origin=<?php echo site_url(); ?>" frameborder="0"></iframe>

    For a future update to the plugin you may consider creating a shortcode_atts to hold the youtube player's parameters and then write up some directions/direct people to the link I posted above/on your admin page make a bunch of metadata boxes to grab the info. Warm regards,

    -Brian Peterson
    KD

  3. PoseLab
    Member
    Plugin Author

    Posted 1 year ago #

    Hi
    You have "related" feature in version 1.5.3

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.