CHAPTER 2

THIS IS A THEME

THE THEME IS what your visitors see, it is the skin for your content, the GUI and design of your Web site. Creating a nice-looking design is one thing, translating it to something that WordPress can interpret is another. That is where the theme and its files come in.

This chapter is all about understanding the theme files, and then doing a few interesting things with them. It is the first step towards further development of your own theme, really.

ABOUT THEMES

I touch this briefly in Chapter 1, so you already know that your theme consists of at least one main stylesheet and some template files. The template files are PHP files containing the code snippets that you need to display your site's content. A few key template files are header.php, index.php, sidebar.php, and footer.php. And the functions.php template file is a bit different from the other ones; it really isn't displaying a part of your site, but rather adds functionality to it.

  • Stylesheet file: Defines the appearance of your theme, and contains the WordPress specific theme declaration at the top
  • Template file: Usually outputs your content to your Web site with the loop
  • Functions.php file: Allows you to add other new features (such as plugins)
  • Other files: Like images, Java Scripts, and so on

I rely on the Twenty Ten theme to show off these things in this chapter. Twenty Ten replaced the old default theme, formerly known as Kubrick, in WordPress 3.0; the Twenty Ten theme now ships as the WordPress ...

Get SMASHING: WordPress Themes: MAKING WORDPRESS BEAUTIFUL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.