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
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 need to make your Web site. Everything from the color of the background to the layout of the content is contained in this set of files.
The difference between a template and a theme can cause confusion. Templates are individual files. Each template file provides the structure in which your content will display. A theme is a set of templates. The theme uses the templates to make the whole site.
Understanding where the WordPress theme files are located on your web server gives you the ability to find and edit them, as needed. You can view and edit WordPress theme files, using two different methods, by following these steps:
The correct location is /wp-content/themes/. When you open this folder, you find the /twentyten theme folder.
If a theme is uploaded to any folder other than /wp-content/themes, it won't work.
When you open the Twenty Ten theme folder (see Figure 3-1), you see several files. At minimum, you find these five templates in the default theme:
These files are the main WordPress template files, and we discuss them in more detail in this chapter. There are several template files, however, and you should try to explore all of them if you can. Take a peek inside and see the different template functions they contain. These filenames are the same in every WordPress theme.
This page lists the various templates available within the active theme. (Figure 3-2 shows the templates in the default Twenty Ten theme.) A text box on the left side of the screen displays the contents of each template, and this box is also where you can edit the template file(s). To view and edit a template file, click the template name in the list on the right side of the page.
The Edit Themes page also shows the template tags within the template file. These tags make all the magic happen in your blog; they connect all the templates to form a theme. The next section of this chapter discusses these template tags in detail, showing you what they mean and how they function.
Below the text box on the Edit Themes page is a drop-down menu labeled Documentation. Click the arrow on the right side of the menu, and a list drops down that contains all the template tags used in the template you are currently viewing. This list is helpful when you edit templates, and it gives you some insight into some of the different template tags used to create functions and features within your WordPress theme.
3.147.59.219