Unfortunately Yahoo has deprecated the version 2 of their API and now only version 3 is accepted. In this new version we cannot retrieve data from a channel without authentication. So, for obtaining the same result as in my article is needed to write a WP plugin where you have to complete your Youtube API key, your Youtube channel ID… A lot of work for which I don’t have time and I don’t know if worth because there are a lot of plugins which already does that.
Few days ago, Brian Hayes ask on Suffusion Forum how can implement the above video gallery on his own site: www.classicalguitarorlando.com. I wanted to help him, but also I wanted to teach him to add himself the gallery. Because it was a very long discussion I decided to resume it now for those who wish to add this nice presentation of their own youtube channels. Because I really like Brian’s music, I used his channel for exemplification.
Is nothing more than to add a jQuery plugin as I presented often on this site. The original code was written by Simone Gianni on jsfiddle. I made 2 small changes:
1. The CSS code was changed as below, for filling the entire disponible width. This code need to be added in your stylesheet (at Suffusion Options -> Backend -> Custom Includes -> Custom Styles if you use Suffusion).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
#player { width: 100%; height: 340px; overflow: hidden; background: #000; position: relative; border: solid 2px gray; } .youtube .carousel { width: 18%; height: 340px; overflow: auto; position: absolute; right:0; top:0; z-index: 3; color:#bbb; } .youtube .thumbnail { margin: 2px; width: 80%; border: 1px solid black; } .youtube iframe.player { width: 80%; height: 340px; overflow: auto; border: 0; } |
2. I changed a little the javascript code for working with WordPress in noConflict mode:
The code above can be added as it into the section of your site, between tags (at Suffusion Options -> Backend -> Custom Includes -> Custom Header Javascript if you use Suffusion).
A more elegant solution is to download the next file which contain only the gallery function: Download your-channel.js. Copy the file on your server by ftp, then link it in the section (in Suffusion add the full path, including “https://” at Suffusion Options -> Backend -> Custom Includes -> First (second/third) External Javascript file – mine is added as https://drafie-design.nl/wp-content/your-channel/your-channel.js).
Then add at Suffusion Options -> Backend -> Custom Includes -> Custom Header Javascript only the trigger function:
1 2 3 4 |
$j=jQuery.noConflict(); $j( document ).ready(function() { $j('#player').youTubeChannel({user:'BrianHayesAgentChan'}); }); |
Of course, in both javascript codes need to change Brian’s channel with yours as “user”.
Finally add the html markup where you want the gallery, in TEXT mode of Edit Page/Post screen or in a text widget in desired widget area: