When you need to display sidebar widget with latest or random video from some YouTube channel or playlist, use plugin **YouTube Channel**!
Simply insert widget to sidebar or shortcode to content, set Channel or Playlist ID, select resource to use and if you wish leave all other options on default. You will get latest video from chosen YouTube channel or playlist embedded on location of widget/shortcode, with optional link to channel at the bottom of the YTC block.
If you like our plugin and you find it useful, please [write review and rate it](https://wordpress.org/support/view/plugin-reviews/youtube-channel).
For manual set of videos from YouTube check out [Easy YouTube Gallery](https://wordpress.org/plugins/easy-youtube-gallery/).
= Features =
* Display latest videos from YouTube Channel (resources are sorted in reverse chronological order based on the date they were created) or videos naturaly sorted from Favorited Videos, Liked Videos and Playlist
* Option to get random video from any of 4 resources
* Responsive (one full width video per row) or non responsive
* Preferred aspect ratio relative to width (16:9 and 4:3)
* Custom width for video embeded object (default is 306px)
* Enhanced Privacy
* Choose to display video as thumbnail (default), HTML5 (iframe) or HTML5 Asynchronous (iframe2)
* Thumbnail mode opens video in lightbox
* Hide or show video title above/below video wrapped to HTML tag by your choice (h3, h4, h5, span or div)
* Custom feed caching timeout
* Optional video autoplay with optional muted audio
* (Optional) *TinyMCE button* on post/page edit (can be disabled on General plugin settings page), which open shortcode GUI generator to help you build shortcode
* Show customized link to channel/vanity/legacy username below videos
* Final look is highly customizable thanks to predefined classes for each element of YTC block!
= Requirements =
For fully functional plugin you need to have PHP 5.3 or newer! If you experience issues on older PHP, we can’t help you as we don’t have access to such old development platform.
If you have an old version of WordPress bundled with jQuery library older than v1.7, some aspects of plugin may not work, as we do not reinclude jQuery library.
= Styling =
You can use `style.css` from theme or other custom location to additionaly style/tweak look of YTC block. You can stick to 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 for video title container above thumbnail/video object
* `.ytc_title_above` – additional class for video title above video/thumbnail
* `.ytc_title_below` – additional class for video title below video/thumbnail
* `.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
= Known Issues =
* Video title and description for embedded playlist mode does not work.
* Removing YouTube logo from playback control bar does not work for all videos
* Async HTML5 video does not work for 2nd same video on same page (two YTC blocks set to Async HTML5)
If WordFence or other malware scan tool detect YouTube Channel fule youtube-channel.php as potential risk because `base64_encode()` and `base64_decode()` functions, remember that we use this two functions to store and restore JSON feeds to transient cache, so potential detection is false positive.
= Credits =
* For playing videos in lightbox we use enhanced [Magnific Popup](http://dimsemenov.com/plugins/magnific-popup/).
* Initial textdomain adds done by [dimadin](http://wordpress.org/extend/plugins/profile/dimadin).
* [Federico Bozo](http://corchoweb.com/) reminded me to fix z-index problem
* Czech localization by [Ladislav Drábek](http://zholesova.cz)
* Spanish localization by [Diego Riaño](http://Digital03.net)
* Danish localisation by [GSAdev v. Georg Adamsen](http://www.gsadev.dk)
= Shortcode =
Along to Widget, you can add YouTube Channel block inline by using shortcode `[youtube_channel]`. Default plugin parameters will be used for shortcode, but you can customize all parameters per shortcode.
* `class` (string) Set custom class if you wish to target special styling for specific YTC block
* `channel` (string) ID of preferred YouTube channel. Do not set full URL to channel, but just last part from URL – ID (name)
* `vanity` (string) part after www.youtube.com/c/ from [Custom URL](https://support.google.com/youtube/answer/2657968?hl=en)
* `username` (string) Optional legacy YouTube username.
* `playlist` (string) ID of preferred YouTube playlist.
* `resource` (int) Resource to use for feed:
* `0` Channel (User uploads)
* `1` Favorites (for defined channel)
* `2` Playlist
* `3` Liked Videos
* `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:
* `3` 16:9 (widescreen)
* `1` 4:3
* `responsive` (bool) Distribute one full width video per row.
* `width` (int) Width of thumbnail and video in pixels.
* `display` (string) Object that will be used to represent video. We have couple predefined options:
* `thumbnail` Thumbnail will be used and video will be loaded in lightbox. (default)
* `iframe` HTML5 (iframe)
* `iframe2` HTML5 (iframe) with asynchronous loading – recommended
* `playlist` Embedded playlist (same behaviour as old function `only_pl`)
* `thumb_quality` (string) Define image quality for thumbnail display mode. Default is `hqdefault`, available:
* `default` Default Quality (120x90px)
* `mqdefault` Medium Quality (320x180px)
* `hqdefault` High Quality (480x360px)
* `sddefault` Standard Definition (640x480px)
* `maxresdefault` Maximum Resolution (1280x720px)
* `no_thumb_title` (bool) By default YouTube thumbnail will have tooltip with info about video title and date of publishing. By setting this option to 1 or true you can hide tooltip
* `themelight` (bool) By default YouTube have dark play controls theme. By setting this option to 1 or true you can get light theme in player (HTML5 and Flash)
* `controls` (bool) Set this option to 1 or true to hide playback controls.
* `autoplay` (bool) Enable autoplay of first video in YTC video stack by setting this option to 1 or true
* `mute` (bool) Set this option to 1 or true to mute videos set to autoplay on load
* `norel` (bool) Set this option to 1 or true to hide related videos after finished playbak
* `nobrand` (bool) Set this option to 1 or true to hide YouTube logo from playback control bar
* *NEW* `nolightbox` (bool) Set this option to 1 or true to prevent YTC block with thumbnail to open in lightbox. If you have other plugin that trigger youtube links for lightbox, that one will steal links from this YTC block.
* *NEW* `target` (string) If you enable nolightbox for specific YTC block, you can force opening of thumbnail links in new tab/window if you set this shortcode option to `_blank` like `target=”_blank”`.
* `showtitle` (string):
* `none` – Hide title
* `above` – Display title above video/thumbnail
* `below` – Display title below video/thumbnail
* `showdesc` (bool) Set to 1 or true to show video description.
* `desclen` (int) Set number of characters to cut down length of video description. Set to 0 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**
* `goto_txt` (string)
* `popup` (int) Control where link to channel will be opened:
* `0` open link in same window
* `2` open link in new window with target=”_blank” anchor attribute
* `link_to` (string) URL to link:
* `none` Hide link (defult)
* `vanity` Vanity custom URL
* `channel` Channel page
* `legacy` Legacy username page
*Please note, to enhance plugin functionality, we can change some shortcode parameters in future.*