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

Including multiple dynamic sidebars in your theme

Although many themes are two-column, with only a single sidebar and corresponding sidebar.php file, there are a number of instances where you'll want two, three, or even four sidebars surrounding your main content. Visit sites such as http://divitodesign.com/ for inspiration on how to use multiple sidebars with your theme.

In older versions of WordPress, having multiple sidebars meant resorting to using PHP's include function, or in-lining the sidebar's contents into your main template files. Luckily, with newer versions of WordPress, you can specify the name of the sidebar to include, by using the get_sidebar function.

Getting ready

We are using a basic template based on the Classic WordPress theme. ...

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