O'Reilly logo

WordPress 3 Cookbook by Jean-Baptiste Jung, Ric Shreves

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

Using conditional tags to control widget display

While WordPress widgets are a great way to create pages that are rich in functionality and content, there are times when you want to be able to control which widgets show on which pages. By default, a widget placed in a widget area will appear on all pages of your site. Some themes, like the default TwentyTen, provide the option to show one set of widgets on the home page and a different set on the interior pages, but sometimes you want more variety.

In this recipe, we explore implementing the Widget Logic plugin, which enables the use of WordPress conditional tags in widgets through the Widgets Manager.

Note

Conditional tags are typically used in template files to control the display of items depending ...

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