YouTube Channel addon for WordPress allows you to display widgets with the latest or random video from YouTube channel, playlist, or favorites. 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.
- Show one or more videos from user channel, favorited videos, liked videos or playlist as thumbnail opened in lightbox Magnific Popup (default), HTML5 (iframe), or Asynchronous HTML5 (iframe2)
- Sort videos in natural, as well as random order.
- Embed single videos or embeddable playlist block (grouped all videos from channel, favorited videos, liked videos, or playlist).
- Choose the preferred aspect ratio of displayed videos and thumbnail (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 shortcode (WPBakery Page Builder ready).
- Toggle video title and display above or below video and/or video description.
- Display link to the channel, vanity, or legacy username page on YouTube.
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:
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!
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.
You can also insert YTC block with shortcode [youtube_channel]. All options for the shortcode are taken from the global settings page, but you can override them by setting individual options to shortcodes.
class(string) custom class for YTC block to target special styling
channel(string) The 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) The ID of preferred YouTube playlist.
resource(int) A resource to use for feed:
1Favorited videos (for defined channel)
3Liked 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.
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) An object that will be used to represent the video. We have a couple of predefined options:
thumbnailThumbnails will be used and the video will be loaded in the lightbox.
iframe2HTML5 (iframe) with asynchronous loading – recommended
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
trueyou can hide the tooltip
themelight(bool) By default, YouTube has a dark play controls theme. By setting this option to
trueyou can get a light theme in the HTML5 player
controls(bool) Set this option to
trueto hide playback controls.
autoplay(bool) Enable autoplay of the first video in the YTC video stack by setting this option to
mute(bool) Set this option to
trueto 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 YTC block with 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
nolightboxfor specific YTC block, you can force the opening of thumbnail links in a new tab/window if you set this shortcode option to
noneDo not display video title
aboveDisplay video title above the video
belowDisplay video title below video
insideDisplay top-aligned title inside thumbnail; if
thumbnailthen treat as
inside_bDisplay bottom aligned title inside thumbnail; if
thumbnailthen treat as
titletagVideo 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:
noneHide link (default)
vanityVanity custom URL
legacyLegacy username page
popup(int) Control where the link to the channel will be opened:
0(int) Open link in the 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 (
- Cache feed for one hour (
- Automatically start video playback (
autoplay=1) in responsive HTML5 player with asynchronous load (
- And show a link to Vanity URL below YTC block (
Customize look and feel
We implemented classes for all 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 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
Localization enabled in version 0.1.3 thanks to Milan Dinić.
And we appreciate your support
Spread voice about YouTube Channel on social networks, and rate and review plugin on WordPress.org