Posted on Jun 14, 2011 in Plugins | 0 comments
The YouTube Sidebar Widget is a simple tool, but works great for showing a list of videos from a YouTube user or a playlist.
Why would you want to do that? Most commonly, to show a list of videos representing your business on your website.
I prefer it to plugins such as Smart YouTube and TubePress for these reasons:
Admittedly, the YouTube Sidebar Widget has a few quirks–but here are some solutions I’ve found.
This is your theme’s fault–although, admittedly, the plugin creators could have prepared CSS for this event. Typically this happens when your theme specified a background image for list items in the sidebar. Try this CSS:
#youtube-sidebar-widget ul li {
background:none;
padding-left:0;
}
This eliminates a background image for the list items and any padding the theme may have added. The padding-left may be unnecessary, or you may need to change margin-left instead.
Mainly, just fiddle around with CSS until it looks right. The tricky part is lining up the thumbnail, play arrow and video title correctly, which mainly takes trial and error depending on the size of your sidebar.
Here’s a passable (FAR from perfect) way to make the thumbnails substantially smaller:
#youtube-sidebar-widget ul li img {
width:120px;
height:90px;
}
#youtube-sidebar-widget ul li div.play_arrow {
margin-top:-95px!important;
margin-left:10px!important;
}
#youtube-sidebar-widget ul li a {
text-align:left;
}
Honestly, it’s probably easier to just remove the play button completely than it is to get it lined up properly. See below.
The image showing the play button over each video thumbnail can be a bit quirky, location-wise. If you have trouble with it, just remove it, like so:
#youtube-sidebar-widget ul li div.play_arrow {
display:none;
}
I ran into this problem with the widget myself. Through trial and error, I was able to figure it out: allow_url_fopen was off in my php.ini.
If your php.ini has “display_errors” turned off, all you will see is “Service unavailable” where the widget is supposed to appear on the page.
If “display_errors” is turned on, you see something like this:
Warning: simplexml_load_file() [function.simplexml-load-file]: URL file-access is disabled in the server configuration in /home/mysite/public_html/wp-content/plugins/youtube-sidebar-widget/youtube-sidebar-widget.php on line 100
Warning: simplexml_load_file(http://gdata.youtube.com/feeds/api/playlists/17735FFE917E0061?v=2) [function.simplexml-load-file]: failed to open stream: no suitable wrapper could be found in /home/mysite/public_html/wp-content/plugins/youtube-sidebar-widget/youtube-sidebar-widget.php on line 100
Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "http://gdata.youtube.com/feeds/api/playlists/17735FFE917E0061?v=2" in /home/mysite/public_html/wp-content/plugins/youtube-sidebar-widget/youtube-sidebar-widget.php on line 100
Service Unavailable.
Hopefully the plugin authors will change what the widget uses, as some web hosts have “allow_url_fopen” set to “off” by default. If you see messages like this, talk to your web host tech support and see if they can help you with these settings.