WordPress For Dummies
Book image
Explore Book Buy On Amazon

WordPress offers four main templates to create your own theme. You can also edit the template tags in the theme you're currently using. Those four main templates are Header, Main Index, Sidebar, and Footer.

The Header template

The Header template for your WordPress themes is the starting point for every WordPress theme because it tells Web browsers information such as the title and URL of your blog.

You can use the bloginfo(); tag plus a little HTML code to display your blog name and tagline. Most blogs have a clickable title, which is a site title that takes you back to the main page when it's clicked.

The Main Index template

The Main Index template drags your blog posts out of the MySQL database and inserts them into your blog. The filename of the Main Index template is index.php. The first template tag in the Main Index template calls in the Header template, meaning that it pulls the information from the Header template into the Main Index template.

Your theme can work without calling in the Header template, but it'll be missing several essential pieces. Without the call to the Header template, your blog resembles this image:

image0.jpg

The Sidebar template

The filename of the Sidebar template is sidebar.php. Typically, the sidebar appears on the right or left side of your WordPress template. In the default Twenty Ten theme, the sidebar is displayed on the right side of the template, by default:

image1.jpg

Similarly to the Header template, the Sidebar template is called into the Main Index template.

The Footer template

The filename of the Footer template is footer.php. Usually, the footer sits at the bottom of the page and contains brief information about the site, such as copyright statements and credits to the theme designer or hosting company.

Similarly to the Header and Sidebar templates, the Footer template gets called into the Main Index template.

Other templates

Some other (optional) templates include

  • Comments template (comments.php): You need the Comments template if you plan to host comments on your blog; it provides all the template tags you need to display those comments.

  • Single Post template (single.php): When your visitors click the title or permalink of a post you've published to your blog, they're taken to that post's individual page.

    image2.jpg
  • Page template (page.php): You can use a Page template for static pages.

  • Search Results (search.php): When someone uses the search feature to search your site for specific keywords, this template formats the return of those results.

  • 404 template (404.php): Use this template to create a custom 404 error page, which is the page visitors get when the browser can't find the page requested.

About This Article

This article can be found in the category: