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.
- 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.
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 a YTC block with a shortcode
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 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:
1DEPRECATED Favourited videos (for defined channel)
3DEPRECATED 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.
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 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
nolightboxfor specific YTC blocks, you can force the opening of thumbnail links in a new tab/window if you set this shortcode option to
noneDo not display the video title
aboveDisplay the video title above the video
belowDisplay the video title below the 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 the 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 the YTC block (
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