My YouTube Channel

YouTube Channel

My YouTube Channel addon for WordPress allows you to display widgets with the latest or random video from a YouTube channel or playlist. After installation, add the widget to the sidebar, enter the name of the channel or playlist ID, and the latest video from the selected resource will be shown on your site.

Jump to: Features | Download | Installation | FAQ | YouTube Data API Key | Usage | Shortcode | Customize | Your Support

Features

  • Show one or more videos from the user channel or playlist as a thumbnail opened in lightbox Bigger Picture (default), HTML5 (iframe), Asynchronous HTML5 (iframe2) or Embed Playlist (playlist)
  • Sort videos in natural, as well as random order.
  • Embed single videos or embeddable playlist block (grouped all videos from channel or playlist).
  • Choose the preferred aspect ratio of displayed videos and thumbnails (16:9 or 4:3)
  • Enable video autoplay (not on mobile devices) with optionally muted videos.
  • Add it as a widget or inline element to the page content with a shortcode (WPBakery Page Builder ready).
  • Toggle the video title and display the above/below/inside video and/or video description.
  • Display a link to the channel or handle on YouTube.

Download

The ChangeLog you can find here. To download the plugin, visit the official WordPress.org page https://wordpress.org/plugins/youtube-channel/ or get the package from below:

Installation

YouTube Data API Key

Version 3 brings support for YouTube Data API v3. To make the plugin work, you must generate your own YouTube Data API Key and insert it on the Global plugin settings page.

Learn more about Obtaining authorization credentials and watch the explanation video below.

While you follow the video tutorial above, you are free to create Server Key. NEWER SHARE YOUR API KEY WITH OTHERS!

Usage

Straightaway after activation on the Plugins page, update global plugin settings, then add the widget to the sidebar on Appearance Widgets, and proceed with widget configuration.

Until you set your preferred Channel ID in plugin settings, in the meantime your website will show a video from my channel. All other options are optional.

Shortcode

You can also insert a YTC block with a shortcode

Oops, something went wrong.

All options for the shortcode are taken from the global settings page, but you can override them by setting individual options to shortcodes.

General Settings

  • class (string) custom class for YTC block to target special styling
  • channel (string) The ID of your preferred YouTube channel, and can get it from https://www.youtube.com/account_advanced
  • vanity (string) DEPRECATED custom vanity name
  • username (string) DEPRECATED legacy YouTube username
  • playlist (string) The ID of the preferred YouTube playlist.
  • resource(int) A resource to use for feed:
    • 0 Channel
    • 1 DEPRECATED Favourited videos (for defined channel)
    • 2 Playlist
    • 3 DEPRECATED Liked videos (for defined channel)
  • cache (int) The period in seconds for caching feed. You can disable caching by setting this option to 0, but if you have a lot of visits, consider at least short caching (a couple of minutes).
  • fetch (int) Number of videos that will be used as stack for random pick (min 2, max 50)
  • num (int) The number of videos to display per YTC block.
  • random (bool) Option to randomize videos on every page load.

Video Settings

  • ratio(int) Set preferred aspect ratio for thumbnail and video. You can use:
    • 3 16:9 (widescreen)
    • 1 4:3
  • responsive (bool) To enable responsive thumbnail or embedded video player.
  • width (int) Width of thumbnail and video in pixels.
  • display(string) An object that will be used to represent the video. We have a couple of predefined options:
    • thumbnail Thumbnails will be used and the video will be loaded in the lightbox.
    • iframe HTML5 (iframe)
    • iframe2 HTML5 (iframe) with asynchronous loading – recommended
    • palylist Embedded playlist
  • no_thumb_title (bool) By default, the YouTube thumbnail will have a tooltip with info about the video title and date of publishing. By setting this option to 1 or true you can hide the tooltip
  • themelight (bool) By default, YouTube has a dark play controls theme. By setting this option to 1 or true you can get a light theme in the HTML5 player
  • controls (bool) Set this option to 1 or true to hide playback controls.
  • autoplay (bool) Enable autoplay of the first video in the YTC video stack by setting this option to 1 or true
  • mute (bool) Set this option to 1 or true to mute videos set to autoplay on load
  • norel (bool) Set this option to 1 or true to hide related videos after finished playback
  • nobrand (bool) Set this option to 1 or true to hide the YouTube logo from the playback control bar
  • nolightbox (bool) Set this option to 1 or true to prevent the YTC block with the thumbnail to open in the lightbox. If you have another plugin that triggers youtube links for lightbox, that one will steal links from this YTC block.
  • target (string) If you enable nolightbox for specific YTC blocks, you can force the opening of thumbnail links in a new tab/window if you set this shortcode option to _blank like target="_blank".

Content Layout

  • showtitle(string)
    • none Do not display the video title
    • above Display the video title above the video
    • below Display the video title below the video
    • inside Display top-aligned title inside thumbnail; if display is not thumbnail then treat as above
    • inside_b Display bottom aligned title inside thumbnail; if display is not thumbnail then treat as below
  • titletag Video title HTML tag to wrap title (H3, H4, H5, div, span, strong, etc)
  • showdesc (bool) Set to 1 or true to show video description. Disabled by default.
  • desclen (int) Set the number of characters to cut down the length of the video description. Set to 0 (zero) to use full-length description.
  • noinfo (bool) Set to 1 or true to hide overlay video info (from an embedded player)
  • noanno (bool) Set to 1 or true to hide overlay video annotations (from an embedded player)

Link to Channel

  • link_to(string) URL where link will lead:
    • none Hide link (default)
    • vanity Vanity custom URL
    • channel Channel page
    • legacy Legacy username page
  • popup(int) Control where the link to the channel will be opened:
    • 0 (int) Open link in the same window
    • 1 (int) Open link in new window with JavaScript
    • 2 (int) Open link in new window with target=”_blank” anchor attribute
  • goto_txt (string) Text that will be set for link

Shortcode Example

Solving Rubik's Cube on the beach

Shortcode Explained

  • Get one (num=1) random (random=1) video from the YouTube channel (resource=0) UCRPqmcpGcJ_gFtTmN_a4aVA (channel=UCRPqmcpGcJ_gFtTmN_a4aVA)
  • Cache feed for one hour (cache=3600)
  • Automatically start video playback (autoplay=1) in responsive HTML5 player with asynchronous load (show=iframe2)
  • And show a link to Vanity URL below the YTC block (link_to=vanity)

Customize the look and feel

We implemented classes for all My YouTube Channel objects, so we can easily style the presence of YTC by personal preferences. Simply add to style.css for your theme styling for classes:

  • .widget_youtube-channel – class of the whole widget (parent for widget title and YTC block)
  • .youtube_channel – YTC block wrapper class. Additional classes are available:
    • .default – for non-responsive block
    • .responsive – when you have enabled the responsive option
  • .ytc_title – class of H3 tag for video title above thumbnail/video object
  • .ytc_video_container – class of container for a single item, plus:
    • .ytc_video_1, .ytc_video_2, … – class of container for a single item with ordering number of items in the widget
    • .ytc_video_first – class of the first container for a single item
    • .ytc_video_mid – class of all other containers for a single item
    • .ytc_video_last – class of the last container for a single item
    • .ar16_9 – class for Aspect Ratio 16:9
    • .ar4_3 – class for Aspect Ration 4:3
  • .ytc_thumb – class of anchor for Thumbnail mode
  • .fluid-width-video-wrapper – class for parent element of IFRAME for enabled responsive
  • .ytc_description – class for video description text below thumbnail/video object
  • .ytc_link – class of container for a link to the channel

And we appreciate your support

Spread voice about My YouTube Channel on social networks, and rate and review the plugin on WordPress.org

95 responses to “My YouTube Channel”

  1. Hi, I cant get the pluggin to work. Here is the debug code i am getting.

    server: Apache/2.2.25 (Unix) mod_hive/3.6 mod_ssl/2.2.25 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_qos/10.10 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_jk/1.2.37

  2. I installed your youtube channel plugin, but have a problem. I have set it up, but from the site I click on visit youtube channel (TradingOptions4Income) it takes me to youtube and youtube says channel doesn’t exist. But it does exist, I can go to it with no problem. I have checked the typing in the link and its correct. Can you offer any suggestions?

    Doug

  3. Since the update this us the error we are getting. Any suggestions. Thank you.

    Warning: base64_decode() expects parameter 1 to be string, object given in /home/robco/public_html/hoodlumfightgearnews/blog/wp-content/plugins/youtube-channel/youtube-channel.php on line 574

    • Yes, sorry for troubles.
      Because we changed caching method, from Help tab on plugin Settings page do ReCache (read help page).
      That issue will be self-solved when previous cache expire.

  4. Hi, I cant get the pluggin to work. Here is the debug code i am getting.

    server: Apache/2.2.29 (Unix)
    php: 5.3.29
    wp: 4.0
    ytc: 2.4.0.2
    url: www.pixelbirnen.de
    title: null
    class: null
    channel: Pixelbirnen TV
    vidqty: 1
    playlist: null
    use_res: null
    cache_time: null
    only_pl: null
    getrnd: null
    maxrnd: 25
    goto_txt: null
    showgoto: null
    popup_goto: null
    showtitle: null
    showvidesc: null
    descappend: …
    videsclen: null
    width: 306
    to_show: thumbnail
    autoplay: null
    autoplay_mute: null
    norel: null
    controls: null
    fixnoitem: null
    ratio: 3
    fixyt: null
    hideinfo: null
    hideanno: null
    themelight: null
    debugon: on
    userchan: null
    enhprivacy: null

    Thanks For Help!!

    • If you click “Check here why” link, you’ll get message from Youtube

      Invalid value for parameter: username

      So, Pixelbirnen TV is wrong YouTube username. Please provide URL to your YouTube channel page.

  5. thank you ,
    now it works.
    But there is a new error .
    The plugin is now running sometimes yes sometimes no.

    server: Apache/2.2.29 (Unix)
    php: 5.3.29
    wp: 4.0
    ytc: 2.4.0.2
    url: www.pixelbirnen.de
    title: Pixelbirnen TV @ Youtube
    class: null
    channel: UCS2o749CY-VNJDyKIxYFsLw
    vidqty: 2
    playlist: null
    use_res: null
    cache_time: null
    only_pl: null
    getrnd: null
    maxrnd: 25
    goto_txt: null
    showgoto: null
    popup_goto: null
    showtitle: on
    showvidesc: null
    descappend: …
    videsclen: null
    width: 280
    to_show: thumbnail
    autoplay: null
    autoplay_mute: null
    norel: null
    controls: null
    fixnoitem: null
    ratio: 3
    fixyt: null
    hideinfo: null
    hideanno: null
    themelight: null
    debugon: on
    userchan: null
    enhprivacy: null

    • I refreshed your homepage and Gewinnspiele page 10+ times, and every time YouTube Channel displayed two video thumbnails.

      Please explain “running sometimes yes sometimes no” (some error, screenshot, something that I can understand better) 🙂

  6. TREMENDOUS!!! Thank you man! If there is somewhere I can give you a “high five” with a great review then please let me know. Not only is this an excellent plugin that is easy to use, but also they have excellent technical support to help get it perfectly right or be open to suggestions for future updates. It works PERFECTLY! Thank you!

  7. Could you give us an example of the shortcode with revisions in action please so we can see the correct syntax to use?

    Is it possible through using the shortcode overrides for ‘channel’ to display different channels on different pages using this plugin?

      • Thank you SO much! That small little piece of sample code gave me the answer I needed so now i can add a mix of channels on my niche sites.

        Thanks again!

  8. hello,

    i just got a ” Ups, something went wrong. ”
    and i don’t know why D:

    here’s the JSON log:

    date:Mon, 11 May 2015 04:26:56 +0000
    server:Apache
    php:5.5.21
    wp:4.2.2
    ytc:3.0.3
    url:caipiravalley.com.br
    widget_id:youtube-channel-2
    title:Youtube
    class:
    channel:UCJAbkIY17zAmCTNQHH0bQoQ
    username:Gameplayrj
    playlist:
    vanity:
    num:1
    resource:0
    cache:300
    only_pl:false
    random:false
    fetch:10
    showgoto:on
    goto_txt:Visite o Caipira Valley no Youtube!
    popup_goto:2
    link_to:1
    showtitle:on
    showdesc:false
    descappend:…
    desclen:0
    width:306
    responsive:on
    display:thumbnail
    no_thumb_title:false
    autoplay:false
    autoplay_mute:false
    norel:on
    modestbranding:false
    controls:false
    ratio:3
    hideinfo:
    hideanno:
    themelight:
    privacy:

    And, which file should i edit if i want to change the ‘go to text’ to a ‘go to image’?

    Best regards,
    Danilo.

  9. sorry for not had read that before, and thank you for the fast support!
    here we go with the questions of the topic:

    1 – caipiravalley.com.br
    2 – WP 2.2.2
    3 – YTC 3.0.3
    4 – No caching plugin
    5 – I made a browser API key and just set the URL of my website
    6 – I was using the plugin by widget in my blog rigth sidebar
    7 – I just installed it and when i refreshed my website it didn’t work
    8 – I was just expecting it to show the video thumb(i don’t think this question apply for me haha)

    that’s it, thank you for the awesome plugin.

    Regards,
    Danilo.

  10. Except you use WP 4.2.2 instead 2.2.2 😉 all other looks OK.

    Remove URL of website from API Key on Google, that should resolve issue. I had no success to make that restriction to work.

    • Hi Carolyn,

      Message “Coming soon…” is printed when there is no YOUTUBE_DATA_API_KEY in wp-config.php. So please, check did you uploaded wp-config.php back to server after you added API Key per instructions?

  11. I generated the code, but now I cannot find wp-config. I have looked all through the edit settings for this youtube channel widget, still yet I cannot find where to insert the YOUTUBE_DATA_API_KEY.

  12. I have enter code into wp-config.php , “define(‘YOUTUBE_DATA_API_KEY’, ‘AIzaSyBZHB7qZBSeA53CBQwoWijYMRC2aXRfnZU’);” , but the problem still remain >> YouTube Channel version 3+ requires YouTube DATA API Key to work . My data API key should can be work as i have follow the steps above

    • Please check did you uploaded file to server. If it remain on your computer, then wp-config.php is unmodified on server. And I don’t kidding, already had users with exactly that problem – file modified in localhost but not uploaded to server.

  13. I currently open my wordpress in localhost, 127.0.0.1/wordpress/ , its still cannot address the problems as all steps i have try.

  14. Having to uninstall plugin for now; having to touch wp-config.php manually negates the ease of using plugins. This should be something we can add into the plugins settings within the dashboard, never manually editing php.

  15. Then enable debugging in WordPress and tell me is there something mentioned regarding YouTube Channel plugin?

    Or, add to active theme functions.php following code:

    echo ( defined('YOUTUBE_DATA_API_KEY') ) ? YOUTUBE_DATA_API_KEY : "FAIL";
    

    and tell me did you got your Data API key or word “FAIL” when you load website on localhost (at the beginning of BODY)?

  16. Thanks for getting back to me. Now that I have done as you said, the widget says, “Ups, something went wrong.”

  17. Isn’t there a way to install the api key without digging into the code? I tried it – I am not a programmer and it didn’t work. I loved your ap until you did this…so not it is down and off my site. Will you be integrating it at any time?

  18. I just updated the plugin today, 5/14/2015, and the dashboard doesn’t look like the one above where I can plug in the API key. In fact, nothing changed when I updated the plugin. Any suggestions?

  19. Thanks! Ok, it’s all done but it still says “Oops, something went wrong” where the player is supposed to be on my home page. I’m not sure what legacy YT name is but I’m not quite sure that that is the problem.

  20. I have a question. Before the api changes. i was using a channel that i favorite the most.I’m having a hard time getting to work.Is the api changes work only for the author of the channel and not others?

  21. The plugin stopped working. I added the new api key and updated everything, but I’m hetting an “Oops something went wrong.” for the homepage widget. Any thoughts?

  22. The plugin stopped working. I added the new api key and updated everything, but I’m hetting an “Oops something went wrong.” for the homepage widget. Any thoughts?

    Nevermind it’s working now. Had to remove the server ip address.

  23. sorry for the late reply.I got it working removing the server ip address in the api..

  24. After update I am getting: YTC ERROR: You have set to display videos from Channel (User uploads) [resource list ID: UU7EnSWFvi1ZDBnfy-fpGasQ], but there have no public videos in that resouce.

    Can you help me?

  25. Hi Aleksandar,

    Is there any way to enable the auto play function of a video when a user hovers with his mouse over that video?

    Regards
    Josh

    • Hi Josh,

      No, there is no such option in plugin because that has not good solution globally, and not mobile friendly.
      But, you can use JavaScript to do that on your own website if you wish.

      Cheers

    • Hi Hans,

      Well, exclude iframe with class .mfp-iframe from this rule in your style.css file (line 476):

      media="screen"
      iframe[src*="youtube.com"], iframe[src*="youtu.be"] {
      width: 425px !important;
      height: 265px !important;
      }

      With that important rule you killed responsiveness.

  26. This code in css is used to display the normal embeds right in blogpostings. So it cannot be changed. Or do you see another solution? For example what about the dynamic wall? Do you have some code for that somewhere?

    • Fire your developer (just kidding 🙂 ) and replace old CSS rule with this:

      media="screen"
      iframe[src*="youtube.com"]:not(.mfp-iframe), iframe[src*="youtu.be"]:not(.mfp-iframe) {
      width: 425px !important;
      height: 265px !important;
      }

      Regarding Dynamic Wall from 3.0.8alpha3 version (actually, gallery mode will be implemented probably to v3.1 because require more testing), when you select gallery for “What to show”, everything should work out-of-the-box. Have you played with it?

  27. Thx. Will give him this suggestion (of the code 😉 )
    I did not play with it. Is it possible to have playlists as gallery? I thought I saw that it is just the channel.

  28. Did the suggested changes and got my api. Now works fine and have three channels on the site I do for a local charity for free.

    However, if I try and insert the ip in the api credentials the plugiin stops working even though I’m sure the ip address is correct as I get it from the hosting control panel.

    If I delete the ip restriction everything works fine. Not a problem on a small low volume site but wondering why it does this.

    • Hi Colin,

      Somehow Google detect wrong IP of host. Sometime it works, but in most cases does not work.
      Btw, even on high traffic websites with enabled YTC feed cache for at least 5 minutes, YouTube Data API quota will have low usage rate because API is queued only once per 5 minute for individual feed.

      That is why I focused to fetch feeds through PHP than through JavaScript (browser key), as with PHP we can cache feed to WP database.

      Cheers

  29. Nice plugin, got it to work.

    What shortcode(s) would I use to create 12 thumbnails, that are responsive and will open as a single video in a light box?

    Beer coming your way 😉

    • Try with:
      [youtube_channel num=12 responsive=1 display=thumbnail]

      Also, in general settins set channel or playlist ID and select resource which you wish to use. Or set them directly in shortcode.

      I’m happy to receive at least one more cold beer 😉

  30. Nope. tried the [youtube_channel num=12 responsive=1 display=thumbnail]

    Under general settings: Resource to use – playlist, fetch 12 show 12.
    Under Video: What to show “Embedded Playlist.

    ???

  31. Actually I just found what I want, with your “YouTube Channel 3 – Display: Gallery (default)”. Just signed up to beta test this.

    When do you think it may be ready for full release?

    BTW Thanks for all your help!

  32. Hello Sir/Madam, I can’t find the solution from (YTC ERROR: There are no HTTP transports available which can complete the requested request.)and I can’t not click on (Video , Content, Link to channel,tools,…but it auto click on general )please help me now.

  33. Your plugin never works throwing error about API key, but the SAME API works with another plugin.
    Any ideas?
    I’d like to test yours since the other plugin always shows a giant video before the channel thumbnails, and I only want the thumbs.

    Thanks.

  34. We are having some trouble adding a playlist from youtube. Could you give us some assistance with this please?

  35. Three questions:

    First question – Is there a way to allow users to skip to the next video in the playlist if they do not like the one currently playing or do they have to wait until the video finishes before able to watch the next?

    Second question – videos do not seem to automatically roll over to the next video in the playlist after first one finishes. It just stops and shows the play button. If you press, the original video replays.

    Third question – Is there a way to make the videos play automatically as soon as a visitor hits my website?

    I just found your plugin tonight. Thanks for the videos, it made for a painless setup. This plugin to be exactly what I was looking for!

    • Hello,

      1) If you leave visible playback controls for embedded playlist, then visitor can jump to previous/next video in playlist.
      2) If you enable autoplay and set display to embedded playlist, then videos will autoplay. Behaviour can be affected only if visitor have on own YouTube profile disabled autoplay for videos.
      3) Yes, enable autoplay option and for Display select one of options different than Thumbnail.

      Cheers,
      Aleksandar

  36. I really wish you would have added looping for videos!

    I am randomly pulling in 1 video from a channel that will be looped. So every visit pulls up a random video to be looped. I guess looping would only be applied to single videos fetches (easily anyway).

    Other than that, I love your plugin.

    • Hi Sam,

      Actually, no one ever asked for that option. Can you please send me diff file for plugin so I can apply patch and include looping in next release?

      You can put content of diff file to pastebin.com and then send in reply to this comment link to that paste.

      Thanks,
      Aleksandar

  37. Hi There..

    You have an excellent PlugIn for WP, But after update to WP 4.6.1 mute does not work..

    how I can get Muted autoplay back to work?

    t:-j

    • Hello again Jari,

      I could not reproduce issue you referring and on my WP 4.6.1 YTC with autoplay mute works.

      Can you please tell me how you inserted YTC block (shortcode or widget)? Do you select iframe2 (HTML5 Async) display with enabled autoplay and mute, or you use some other combination? Can you please provide link to page where you have inserted YTC.

      Cheers,
      Aleksandar

  38. I’ve found this documentation really useful. However, I cannot get the videos to open in lightbox while using shortcode mode.

    Can you help me please? Thanks.

  39. Hello
    I love your plugin but how can i get more than 50 videos ?
    50 is not enough
    Why limit to 50 videos only ?

    • Hi Raffi, Google through YouTube Data API feed provide data by chunks of 50 items. To avoid looping through more than one chunk and because mainly most of users of plugin do not need more than 50 videos, I decided to keep that limit in free version of plugin and leave “pagging” (feature to fetch all videos from resource) for Premium version (which I still have not developed).

  40. Hi
    Your plugin est terrific ! great job !
    i try to create a wall of videos ( 4 colums and 4 row)
    (every thumbs should have the same size)
    i did it but every time the first video appears on full width
    is it possible to do it ?

    • Hi Citrix,

      Thank you for kind words!
      Are you trying to get 1:1 (square) thumbnails? Or regular 16:9 thumbnails are okay?

      Can you please provide link to the page where you have inserted shortcode and full shortcode syntax that you use there? I’ll check what you have done and advise what you have to do to achieve what you wish.

      You can use contact form if you wish to keep website link private.

  41. I noticed you have the option to have columns in your easy youtube gallery. can you do that with the youtube channel?

    • Hi Jonathan,

      In YouTube Channel you can easily tweak columns with couple lines of custom CSS, just enable option to use responsive videos.
      If you need help, feel free to provide link to page with YouTube Channel block and how many columns you wish to achieve?

  42. Hi,
    I’m using the 3.0.11.7 version and I’m facing a wired issue… The settings often reset alone, without touching anything… How can I detect where it can come from

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.