December 15th, 2009 by

With Youtube Videobox plugin you can add unlimited number of videos to your site in a painless way. All you need is to copy and paste code of the video into the Youtube Videobox widget.
The original video code from Youtube doesn’t pass W3C validation. My filtered video code will keep your site XHTML valid. Of course only in case the site was valid beforehand :) .

Latest version 0.9.1

Download the latest version

Features

  • Plugin outputs XHTML valid code
  • Change sizes of the video comfortably through widget panel
  • Due to WP widget architecture you can add unlimited number of the widget instances

How-to

  • Download plugin from WordPress repository.
  • Unzip and upload it to wp-contentplugins. Or you can go to the admin panel:
    • Plugins –> Add New
    • Type “youtube videobox” into the search field.
    • Install.
  • Drag the widget instance to the widget panel of your choice
  • Add width, height and code of the video
  • If you want to display customized video player, you have to tick “Enable parameters”. Don’t do that if you want to keep code of the video XHTML valid.

Create widgets and put your videos anywhere

Adding widgets is not limited only to sidebar. You can widgetize any part of your site. It’s incredibly easy!
This is CSS of the widget. Note that width of the widget is set to auto. This allows using setting different sizes of the video without setting new sizes of the widget in CSS.

.widget            { width: auto; margin: 0px 0 10px 0; }
.widget p          { padding: 10px 10px 10px 10px; }

In functions.php you have to register your sidebar:

<?php
if (function_exists('register_sidebar')) {
//Video widget 1
    register_sidebar(array(
    'before_widget' => '<div id="%1$s" class="%2$s widget">',
    'before_title' => '<h3 class="widgettitle">',
    'after_title' => '</h3>',
    'after_widget' => '</div>',
    'name' => Video widget 1));
//Video widget 2
    register_sidebar(array(
    'before_widget' => '<div id="%1$s" class="%2$s widget">',
    'before_title' => '<h3 class="widgettitle">',
    'after_title' => '</h3>',
    'after_widget' => '</div>',
    'name' => Video widget 2));
}
?>

The last thing we have to do is add widgets to our code.
Video widget 1 in the footer:

<div id="footer">
<?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('Video widget 1')): else : ?>
<!-- some code -->
<?php endif; ?>
</div>

..and Video widget 2 in the sidebar:

<div id="sidebar">
<?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('Video widget 2')): else : ?>
<!-- some code -->
<?php endif; ?>
</div>

20 Responses to “Youtube Video Box Plugin”

  1. Jeff says:

    I’ve just added your plugin to my WordPress blog. I’ve loaded one video into the side panel, but I can’t figure out how to display the other three I want. ideas?

  2. Tom says:

    @Jeff
    Just create new widget the same way you created the first one. The plugin allows creating of unlimited number of widget instances.

  3. Cathy says:

    Hi,
    I installed your plugin. You can look on my homepage on the sidebar where I put it. I am trying to put the youtube element for news in there. I got the code for it at:
    http://www.google.com/webelements/youtube/news/

    I copied their code and went to the widget that I got from your plugin and pasted it into the box. I set the wdth/lnth to 200 x 200. But I just get this empty screen on my sidebar.

    Is it not possible to use this youtube news feed? Do I just use code for one video at a time only?

    I really like this new youtube element.

    Let me know if you have any idea if I’m doing something wrong or if its just not possible.

    Maybe I need to put their code someplace else?

    Thnx.

    If I get this working I will send a little donation. I am unemployed right now, but I do have a little money left in my paypal account.

  4. Tom says:

    @Cathy
    My plugin supports adding only 1 video per widget.
    For adding the news element you can use text box widget.
    Adding other elements than embedded videos will be available in next versions of the widget.

  5. Cathy says:

    Hi,
    Thanks. Obviously I dont know alot about this stuff yet. But I got it working. I’ll have to send a little donation your way. thanks.

  6. Cathy says:

    can’t find donation link. Do you have one? some people have them for plugins. I’ll check back.

  7. tosteng says:

    Thanks for your plugin >I will testing with my site “thaiboxingsite”

  8. kpss sitesi says:

    very thanks for plugin

  9. Kim says:

    Totally confused – After I download and unzip the file, how do I do this “upload it to wp-contentplugins. Or you can go to the admin panel?” Where are these? In my WP page, hidden in My Dashboard somewhere? I don’t know what an Admin. panel is or where it is. I recently started using the most current free WP version. And I have a Mac. Please help! Thx.

  10. jessica says:

    Love the plugin. How do I get the videos to play on people’s iphones and itouches?

  11. Matt says:

    Thank you for the plugin! I love it. It works like a charm. Have you tried to advance this like this plugin: http://www.gopiplus.com/work/2010/07/18/youtube-with-fancy-zoom/#comment-2654

    It’s a step in the right direction except the plugin that I linked is not W3C compliant where yours is. To some that might not be a big deal but it means everything to me.

    Anyhow. Thank you again! You Rock!

  12. I have used for plugin for a year, its great. Today when I tried to add a new box (video) to my sidebar all I get is a blank white box below the title. Help! as this is time senitive

  13. Leonardo says:

    Hi, I Just tried to install your plugin and tried to copy/past one of my youtube video link…doesn’t work…I see only a withe box…I tried to select the little window down the plugin but doesn’t work…
    Can you help me please?
    Thank’s!!

Trackbacks/Pingbacks 6

Leave a Reply