O'Reilly logo

SMASHING: WordPress Themes: MAKING WORDPRESS BEAUTIFUL by Thord Daniel Hedengren

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required