Understanding theme structure

The rest of this chapter provides important information about the steps to take when building a WordPress theme, but here is a brief overview of the templates that make up a WordPress theme and where you find them, both on your server and within your WordPress Dashboard. Follow these steps:

1. Connect to your Web server via FTP, and have a look at the existing WordPress themes on your server.

The correct location is /wp-content/themes/ (see Figure 12-1). 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.

2. Open the folder for the Twenty Ten theme (/wp-content/themes/ twentyten), and look at the template files inside.

When you open the Twenty Ten theme folder, you see several files. At minimum, you find these five templates in the default theme:

• Header template (header.php)

• Sidebar template (sidebar.php)

• Footer template (footer.php)

Figure 12-1:

WordPress themes in the /wp-content/ themes folder on your Web server.

• Sidebar template (sidebar.php)

• Footer template (footer.php)

Figure 12-1:

WordPress themes in the /wp-content/ themes folder on your Web server.

These files are the main WordPress template files, and I discuss them in more detail in this chapter. There are several template files, however, and you should try to explore all if you can. Take a peek inside and see the different template functions they contain. These filenames are the same in every WordPress theme. See the "Contemplating the Structure of a WordPress Blog" section, later in this chapter, for more information about these template files.

3. Click the Editor link on the Appearance menu to look at the template files within a theme.

This page lists the various templates available within the active theme. (Figure 12-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

Figure 12-2:

A list of templates available in the default Twenty Ten WordPress theme.

Figure 12-2:

A list of templates available in the default Twenty Ten WordPress theme.

template tags in detail, showing you what they mean and how they function. A later section provides steps for putting them all together to create your own theme (or edit an existing theme).

\V? ^ 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

■ IQJ1 down that contains all of 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.

Top 100 Wordpress Plugins

Top 100 Wordpress Plugins

The bulk of the plugins featured are free and available from the WordPress.org website. However, a few commercial plugins are featured in the Plugin Showcase within this guide. The five plugins in the Plugin Showcase aren’t rated. Less information about them is offered because, in many cases, information such as the last time the plugin was updated isn’t available.

Get My Free Ebook


Post a comment