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

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-content\plugins\. 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.

    In the your youtube.com, click the wheel and play around with the colors of the player.

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>

Buy me a beer