WordPress Tip: Sidebar.php

Posted in Wordpress Tips
Tags: ,

The sidebar.php file usually  consists of only minimal markup needed for outputting the widgets in the side-column widget area, which was registered in functions.php. You can do that with dynamic_sidebar(), and by passing the ID of the widget area wanted, which is side-column, again as registered in functions.php.

This means that the sidebar.php is pretty straightforward to say the least.

You can also have conditional sidebars (i.e. this site), that change content based upon what page/post is being requested.

Reference: http://codex.wordpress.org/Customizing_Your_Sidebar

Leave a Reply

Your email address will not be published. Required fields are marked *

*