CHAPTER 4 • WordPress Theme Essentials 113
matter to you and the theme you want to sell? Well, because WordPress is licensed under
GPL, that means everything relying on WordPress is also covered. This is rocky ground to say
the least, and you should carefully consider how you license your theme. It may also be good
to know that the directory on WordPress.org accepts only themes compatible with the GPL
license, which has (happily) sparked a mass conversion of premium themes to GPL.
THEME CHECKLISTS
When you release a WordPress theme, and to some extent also when you deliver one to a
client or roll out one of your own projects on a theme, there are some mandatory elements.
Naturally, the theme needs to work — that’s the first thing — and that means you need at the
very least the style.css file with the theme information at the top, as well as the index.php file
and whatever other template files you may want to use.
But that’s not all. Before releasing your theme, you should ensure that it meets all the stand-
ards in the following checklists. These checklists can help you avoid the mistake of releasing a
theme and then having to patch it right away.
Development issues
◾ Is the theme validated?
◾ Is there a proper doctype in the header?
◾ Do you call wp_head() and wp_footer()? (Because you really should!)
◾ Is there an RSS feed link in the header declaration? Web browsers need that to see the
feed and add that pretty little icon to the right of the URL.
◾ Have you gotten rid of everything from your local development environment? This can
be anything from local image references to code relating to your svn.
◾ Are you using JavaScript properly? Remember, a lot of themes are shipped with Word-
Press, and there is even a wp_enqueue_script() function for this purpose; see
Chapter 11, “Design Trickery,” for more information.
◾ Are the widget areas working as they should, and do they display default content? If they
are, make sure that the content is relevant and appropriate; otherwise, they shouldn’t
output anything at all.
◾ What about menu areas? Are there any, and how are you handling them? The menu
feature in WordPress helps end users a lot, so you should use it if you can!
◾ Have you added Edit links to posts, Pages, and possibly even comments that are displayed
only when administrators are logged in? This is very handy.
◾ Do the Gravatars work properly?
◾ Did you remember to add CSS for threaded comments, even if you don’t think you’ll use
it? It should support all the settings users can select in the admin interface.
◾ Is your theme ready for localization? Should it be?
◾ Are all the dates and times displaying properly? Try not to code this into the template
files by passing parameters to the_date() and the_time(): It is a lot better to have
the user control these elements in the WordPress admin settings.