YouTube Channel addon for WordPress allows you to display widget with latest or random video from YouTube channel, playlist or favorite. After installation simply add widget to sidebar, enter name of channel or playlist ID, and the latest video from selected resource will be shown on your site.
In addition to show the latest videos, YouTube Channel allow user to:
- show video as HTML5 (iframe), Flash (object), Chromeless Player (flash object) or thumbnail
- show one or more videos
- show random videos from channel, favorites or playlist
- show individual videos from playlist
- embed whole YouTube playlist block
- set aspect ratio of displayed videos (16:9, 16:10 and 4:3)
- set custom video width (default 220 px)
- enable video autoplay (not on mobile devices)
- mute video on autoplay (only for HTML5 option)
- hide video controls from player
- caching youtube feeds
- insert YTC to content with shortcode
And that is not all! You can also:
- for thumbnail mode open video in lightbox
- set custom widget title
- toggle name of video above object
- toggle video info
- toggle visibility and set custom text for link to channel
Or visit official WordPress.org page here http://wordpress.org/plugins/youtube-channel/
Development or previous versions
YouTube Channel is easy to install, same as any other extension. You can do it manual or automatic.
- For manual installation: download, unpack archive and upload directory youtube-channel to wp-content/plugins/ directory on your hosting server with some FTP client (I recommend free and safe FileZilla).
- For automatic installation: go to Plugins → Add New, enter keyword youtube channel, click Search button, click link Install Now.
After activation on Plugins page, add widget to sidebar on Appearance → Widgets, and proceed with widget configuration.
Please note, only Channel ID name is required, or on your site will be displayed video from my channel. All other options are optional.
Add New Widget
How To Get Debug Info
Starting from version 2.2.0 we have global settings page (Settings –> YouTube Channel) where you can set all default options that will be used as defaults for YTC blocks inserted with shortcode.
- Playlist ID: enter YouTube playlist ID (and not playlist name!), or you can paste URL to playlist and YTC will extract playlist ID for you.
- Resource to use: select source of videos to display from. Can be channel, favorites or playlist.
- Embed standard playlist: enable displaying whole playlist block instead individual video from playlist. This option will be displayed only when Channel is selected for Resource to use.
- Fetch # video(s): set quantity of latest channel/playlist videos from which YTC will select random video/s.
- Show # video(s): set number of video objects to be shown
- Use Enhanced Privacy: prevent YouTube to set cookies to visitor’s browser on load
- Fix No items error: while YTC used RSS Feed to fetch video infos from YouTube, this option has usefull if YTC print that error message and when latest uploaded video has not seen because of YouTube caching. Now we use JSON feed but need confirmation that this option have no affect to new way of fetching video infos.
- Show random video: when you wish to show random video on every page load, instead latest video.
- Width: set custom width of video/thumbnail in pixels (default is 220)
- Aspect ratio: chose target aspect ratio for video (custom, 4:3, 16:10 or 16:9)
- What to show: chose between thumbnail, HTML5, Flash or Chromeless player
- Use light theme: set white controls instead default dark gray
- Hide player controls: do not show player controls
- Fix height by controls: when player controls are not hidden, add controls height to video height
- Autoplay video or playlist: if enabled, video will autostart on load
- Show video title: if enabled, video title will be displayed above object
- Show video description: if enabled, video description will be displayed below object
- Description length: set number of characters to cut down length of video description; for full length use 0 (zero)
- Et cetera string: set string to be appended to shortened description
- Hide annotations from video: do not show annotations on video during playback
- Hide video info: do not show video title over video during playback
Link to Channel
- Visit YouTube Channel text: custom call to action text for link to channel. You can use placeholder %channel% that will be replaced with cnannel name. Default text is: Visit channel %channel%
- Show link to channel: toggle link to channel below all videos. Link will open (based on selection from drop-down list below this option):
- same window
- new window with anchor attribute target=”_blank)
Debug YouTube Channel
- Enable debugging: if in some way YouTube Channel does not work as you expect, and you think there is something that not works properly, please enable debugging option and post content from textarea below to support forum, so we can help you and/or fix issue.
You can also insert YTC block with shortcode [youtube_channel]. All options for shortcode are taken from global settings page, but you can override them by setting individual option to shortcode.
channel(string) ID of preferred YouTube channel. Do not set full URL to channel, but just last part from URL – ID (name)
playlist(string) ID of preferred YouTube playlist.
res(int) Resource to use for feed:
1Favorites (for defined channel)
only_pl(bool) If you set to use Playlist as resource, you can embed youtube playlist block instead single video from playlist. Simply set this option to true (
cache(int) 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 (couple minutes).
fetch(int) Number of videos that will be used as stack for random pick (min 2, max 50)
num(int) Number of videos to display per YTC block.
fix(bool) Option to fix No Items error, and also to respect order of videos in feed or playlist.
random(bool) Option to randomize videos on every page load.
ratio(int) Set preferred aspect ratio for thumbnail and video. You can use:
216:10 (computer screen)
width(int) Width of thumbnail and video in pixels.
show(string) Object that will be used to represent video. We have couple predefined options:
thumbnailThumbnail will be used and video will be loaded in lightbox.
iframe2HTML5 (iframe) with asynchronous loading – recommended
objectFlash object (not so good for Apple devices)
chromelessChromeless solution (also not good for Apple devices)
themelight(bool) By default YouTube have dark play controls theme. By setting this option to
trueyou can get light theme in player (HTML5 and Flash)
controls(bool) Set this option to
trueto hide playback controls.
fix_h(bool) If you did not set to hide player controls, you can set this option to
trueto fix video height taken by controls
autoplay(bool) Enable autoplay of first video in YTC video stack by setting this option to
mute(bool) Set this option to
trueto mute videos set to autoplay on load
Link to Channel
Customize look and feel
We implemented classes for all YouTube Channel objects, so we can easy style presence of YTC by personal preferences. Simply add to style.css for your theme styling for classes:
- .widget_youtube_channel – class of whole widget (parent for widget title and YTC block)
- .youtube_channel – YTC block wrapper class
- .ytc_title – class of H3 tag for video title aboe thumbnail/video object
- .ytc_video_container – class of container for single item, plus:
- .ytc_video_1, .ytc_video_2, … – class of container for single item with ordering number of item in widget
- .ytc_video_first – class of first container for single item
- .ytc_video_last – class of last container for single item
- .ytc_video_mid – class of all other containers for single item
- .ytc_description – class for video description text below thumbnail/video object
- .ytc_link – class of container for link to channel
Widget in action
Chromeless video option has taken from plugin Chromeless YouTube.
Localisation enabled in version 0.1.3 thanks to Milan Dinić.