Too often I see themes missing the absolute minimum requirements to make the theme actually work properly. So I figured I’d make a list of things that ALL WordPress themes need to have in them, every time. These are WordPress theme-specific things. I’m not including obvious stuff like HTML and such.
Note: These are my opinions. You may not agree with every one of these. My opinion in that case is that you’re wrong, so there’s little point in arguing with me unless you have a rock-solid reason for disagreeing with me. In other words, I’m not trying to start a flame war, nor am I interested in one. This is just a checklist that I hope theme authors will start following more often. It would make me happy if all themes had these. 🙂
- wp_head() in the HEAD section.
- wp_footer() just before the /BODY tag. (So many themes forget this simple little thing…)
- language_attributes() in the opening HTML tag.
- body_class() in the BODY tag.
- post_class() in whatever surrounds each individual post (probably a DIV).
- Use of get_header(), get_sidebar, and get_footer inside every appropriate page template.
- The Loop inside every page template (exception: very Custom Page Templates).
- Proper use of widgets on the sidebars (dynamic_sidebar, register_sidebar, etc).
- A special image.php template. Image attachments can have their own template and make theme’s have built in nice gallery-like support. You should make a special one of these to fit your layout.
- Comments must use wp_list_comments(). Preferably without using a customized callback. But if you must make a callback, be sure to support threading properly! This is tricky without also having an end-callback. And you should use a List to do it (unordered or ordered, it doesn’t really matter). If you’re using DIVs, you’re doing it wrong.
- The Comments Reply form should have id=”commentform”. If you change this, you’re breaking plugins.
- Similarly, you need to include do_action(‘comment_form’, $post->ID); on your comment form too.
- A couple of useful Custom Page templates. Like a no-sidebar one, or one that has a different number of columns. Just generic ones to let your user have a few built in options.
- New to 2.9: Thumbnail support. Come on, this is cool stuff, every theme needs to have it.
- New to 3.0: Forget doing your own comment form at all. Just make the call to comment_form(). Then adjust it through styling or filters or what have you. Plugin authors will love you for doing this.
- New to 3.0: Nav-menu support. It’s cool. Your users will love you for supporting it.
- New to 3.0: add_theme_support( ‘automatic-feed-links’ ); in the function.php. This will make it do the feed links in the head for you, automagically.
This list is by no means complete. It’s just off the top of my head for now. But honestly, too many themes don’t have even the basic ones, and I’d like to see that fixed. If you’re a theme author, help everybody out, let’s make a list of standards and adhere to them. Users hate editing their themes to support their favorite plugins, and with standards like these, we could make it so that they didn’t have to.