Unlike other blog software like Movable Type, WordPress uses a single template system which might be a blessing or a boon to people. Some people find it easy to use, and some people find it over-simplified. It makes it hard to have different looks for different sections of the site. For example, having the sidebar on the main page but not on sub-pages. Here’s how to covercome that.

if ($single) {
// individual post contents
} else if ($cat) {
// categorical listing contents
} else if ($m) {
// monthly listing contents
} else if ($year) {
// yearly listing contents
} else {
// main page contents

It involves the use of WordPress built in boolean values, which are $single, $cat, $m and $year. The above code is the basic idea how to make use of the booleans to display different content in each type of page.

Tips are courtesy of ElasticDog. Visit the reference for some detailed examples on how to implement this.

Reference: ElasticDog