O'Reilly logo

WordPress 2.8 Themes Cookbook by Lee Jordan, Nick Ohrn

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Making sidebar widgets toggle-able

The extensible nature of widgets and sidebars in WordPress opens those items up to a whole range of possibilities when it comes to making them dynamic. One of the easiest and most noticeable things that you can do is to modify your widgets so that users are able to interact with them. Even the rudimentary interaction provided in this recipe can go a long way to increasing user participation with the site that your theme is deployed on.

Getting started

You need to have a theme created with at least one sidebar registered.

How to do it...

First, you need to change the parameters that you are passing to your sidebar registration function. Find the declaration for your sidebar (usually contained within the functions.php ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required