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), or thumbnail (default)
- show one or more videos
- show videos in regular or random order
- show videos from channel, favorited videos, liked videos or playlist
- show individual videos or embed playable seek YouTube playlist block (with all videos from channel, favourited videos, liked videos or playlist)
- set aspect ratio of displayed videos/thumbnail (16:9 or 4:3)
- set custom basic video width (default 306 px)
- enable video autoplay (not on mobile devices)
- mute video on autoplay
- caching youtube feeds
- insert YTC to content with shortcode (VisualComposer ready)
- NEW! Works with YouTube Data API v3
And that is not all! You can also:
- for thumbnail mode open video in lightbox (Magnific Popup)
- set custom widget title
- toggle name of video above embed and/or description below embed
- move video title below embed
- toggle video info
- toggle visibility and set custom text for link to channel/vanity/legacy username page
Version 3.0.0 brings support for YouTube Data API v3. So, to make plugin work, you must generate your own YouTube Data API Key and insert it on GLobal plugin settings page
Learn more about Obtaining authorization credentials and watch explanation video below.
While you follow video tutorial above, you are free to create Server Key. NEWER SHARE YOUR API KEY IT WITH OTHERS!
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 is required, or on your site will be displayed video from my channel. All other options are optional.
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.
class(string) custom class for YTC block to target special stylig
channel(string) ID of preferred (your) YouTube channel, and you can get it from https://www.youtube.com/account_advanced
vanity(string) custom vanity name
username(string) legacy YouTube username
playlist(string) ID of preferred YouTube playlist.
resource(int) Resource to use for feed:
1Favorited videos (for defined channel)
3Liked videos (for defined channel)
only_pl(bool) If you wish to embed seek playlist for any resource (playlist, channel, liked of favourited videos), simply set this option to true (1 or true). This option will override “random” and “num” parameters.
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.
random(bool) Option to randomize videos on every page load.
ratio(int) Set preferred aspect ratio for thumbnail and video. You can use:
responsive(bool) To enable responsive thumbnail or embedded video player.
width(int) Width of thumbnail and video in pixels.
display(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
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.
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
noneDo not display video title
aboveDisplay video title above video
belowDisplay video title below video
showdesc(bool) Set to 1 or true to show video description. Disabled by default.
desclen(int) Set number of characters to cut down length of video description. Set to 0 (zero) to use full length description.
noinfo(bool) Set to 1 or true to hide overlay video infos (from embedded player)
noanno(bool) Set to 1 or true to hide overlay video annotations (from embedded player)
Link to Channel
link_to(string) URL where link will lead:
noneHide link (default)
vanityVanity custom URL
legacyLegacy username page
popup(int) Control where link to channel will be opened:
0(int) Open link in same window
2(int) Open link in new window with target=”_blank” anchor attribute
goto_txt(string) Text that will be set for link
[youtube_channel channel=UCRPqmcpGcJ_gFtTmN_a4aVA resource=0 cache=3600 num=1 random=1 ratio=2 responsive=1 show=iframe2 autoplay=1 link_to=vanity]
- Get one (num=1) random (random=1) video from 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 link to Vanity URL below YTC block (link_to=vanity)
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_mid – class of all other containers for single item
- .ytc_video_last – class of last container for 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 link to channel
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, feedback in comments below or