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

Displaying different widgets on different pages by using the Widget Logic plugin and conditional tags

Given the different contexts for different page displays, you may wish to display different widgets in sidebars for places like the home page, category archive, or single-post display pages. With dynamic sidebars and the Widget Logic plugin, this is easy to accomplish.

Getting ready

You need to have a theme that uses dynamic sidebars with a sidebar.php template, and at least one of your main theme files must use the get_sidebar function to include the sidebar.

How to do it...

Download the Widget Logic plugin from http://wordpress.org/extend/plugins/widget-logic/. Upload the widget_logic.php file to the plugins directory of your theme's folder.

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