
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

After dabbling for years in the IT industry, Paul Tan initially began this site as a general blog covering various topics of personal interest. With an increasing number of readers paying rapt attention to the motoring stories, one thing led to another and the rest, as they say, is history. An avid electronic gadget aficionado as well as big-time coffee lover, he's also the executive producer of the Driven motoring TV programme.