Ben
Ben is a lifelong Nintendo fan who likes to build websites, and make video games. He buys way too much Lego.
WordPress and Games
Creating widget areas is actually really simple – there are only two steps in the process. The first is initializing the widget area, and the second is inserting the widgets into your theme.
You can actually use one of two functions to create widget sidebars, register_sidebar and register_sidebars. I prefer register_sidebar as this allows you to create multiple sidebars with different settings for each one.
$args = array ( 'name' => 'Sidebar Name', 'id' => 'sidebar-id', 'description' => 'Sidebar Description (shown in the Widget admin)', 'before_widget' => '<li id=\"%1$s\" class=\"widget %2$s\">', 'after_widget' => '</li>', 'before_title' => '<h2 class=\"widgettitle\">', 'after_title' => '</h2>' );
The description is a new property – added in WordPress 2.9. It’s a nice little addition that allows you to describe where and how the widget bar will be used in the theme.
Execution is easy. To execute the widget created in the code above you just have to pass the widget id to the dynamic_sidebar function.
dynamic_sidebar ('sidebar-id');
Full details on the WordPress Widgets API is available on the WordPress Codex.