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), Asynchronous HTML5 (iframe2), Flash (object), Chromeless Player (flash object) or thumbnail
- show one or more videos
- show videos in regular or random order
- show videos from channel, favorites or playlist
- show individual videos from playlist or embed playable YouTube playlist block
- set aspect ratio of displayed videos (16:9, 16:10 and 4:3)
- set custom video width (default 306 px)
- enable video autoplay (not on mobile devices)
- mute video on autoplay (only for HTML5 options)
- hide video controls from player
- caching youtube feeds
- insert YTC to content with shortcode (VisualComposer ready)
And that is not all! You can also:
- for thumbnail mode open video in lightbox (Magnific Popup)
- global plugin settings page powered by Redux Framework
- 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/
ChangeLog you can find here.
Development or previous versions
YouTube Channel is easy to install, same as any other extension. You can do it manually 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, then click link Install Now.
After activation on Plugins page, update global plugin settings, then 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
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.
- Custom CSS Class: target widget styling with custom class.
- 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.
- Aspect ratio: chose target aspect ratio for video (custom, 4:3, 16:10 or 16:9)
- Responsive video: make responsive embedded thumbnail or video block (does not work for Chromeless video)
- Width: set custom width of video/thumbnail in pixels (default is 306)
- 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
- Mute video on autoplay: enable autoplay of first video in YTC block, when inserted as HTML5 element
- Hide related videos: when YouTube finish video playback, related videos are displayed; to prevent that, enable this option
- Hide YT Logo: remove YouTube branding from playback control bar
- 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
If widget does not work as you expecting, and you set all options properly, you can download JSON file with widget settings and details about system (web server, version of PHP, WordPress and Redux Framework, URL to website).
When you download JSON file, send it to support forum, or as attachment directly to linked email address, 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)
responsive(bool) To enable responsive thumbnail or embedded video player.
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
[youtube_channel channel=urkekg res=0 cache=3600 num=1 random=1 ratio=2 responsive=1 show=iframe2 autoplay=1 goto=0]
- Get one (num=1) random (random=1) video from YouTube channel (res=0) urkekg (channel=urkekg)
- Cache feed for one hour (cache=3600)
- Show auto playable (autoplay=1) responsive HTML5 (iframe) with asynchronous load (show=iframe2)
- Do not show link to channel below video (goto=0)
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. Additional classes are available:
- .default – for non-responsive block
- .responsive – when you have enabled responsive option
- .ytc_title – class of H3 tag for video title above 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ć.
And we appreciate your support
Spread voice about YouTube Channel on social networks, rate and review on WordPress.org, feedack in comments below or