Starting with the Basics

A WordPress theme is a collection of WordPress templates made up of WordPress template tags. When we refer to a WordPress theme, we are talking about the group of templates that makes up the theme. When we talk about a WordPress template, we are referring to only one of the template files that contain WordPress template tags. WordPress template tags make all the templates work together as a theme (more about this topic later in the chapter). These files include

  • The theme's stylesheet: (style.css) The stylesheet provides the theme's name, as well as the CSS rules that apply to the theme. (Later in this chapter we go into detail about how stylesheets work.)
  • The main index template: (index.php) The index file is the first file that will be loaded when a visitor comes to your site. It contains the HTML as well as any PHP code needed on your home page.
  • An optional functions file: (functions.php) This optional file is a place where you can add additional functionality to your site via PHP functions.

Template and functions files end with the .php extension. PHP is the scripting language used in WordPress, which your Web server recognizes and interprets as such (Book II, Chapter 3 covers additional details on the PHP language that you will find helpful). These files contain more than just scripts, though. The PHP files also contain HTML, which is the basic markup language of Web pages.

Within this set of PHP files is all the information your browser and Web server ...

Get WordPress® All-in-One For Dummies® 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.