There are several good guides to modifying your old WordPress (pre-2.7) themes to the new WordPress 2.7 and they cover pretty much everything. One thing to remember though is that some of the new features and functions added in will only be present with WordPress 2.7.
This is the case with the new post_class() function which adds in class names for the post box. The Codex puts it like this:
The post_class() outputs the class=”whatever” piece for that div. This includes several different classes of value: post, hentry (for hAtom microformat pages), category-X (where X is the slug of every category the post is in), and tag-X (similar, but with tags). It also adds “sticky” for posts marked as sticky posts. These make it easy to style different parts of the theme in different ways.
Adding it the loop in the right place like this:
<div id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>
This causes problems when you have a theme that you want to be backwards-compatible with prior versions of WordPress. So you need to change it to this:
<?php if (function_exists(“post_class”)) { ?>
<div id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>
<?php } else { ?>
<div id=”post-<?php the_ID(); ?>”>
<?php } ?>
Now it works with previous WordPress versions!

















Trackbacks