Information Technology Reference
In-Depth Information
15
Main Index ( index.php ) —This file describes the area where your blog posts appear. As a tem-
plate, this is also where the other elements of your theme get pulled in to create your blog
page(s).
Header ( header.php ) —This is the top of your blog page, with the title of your blog, the tagline,
and perhaps an image.
Footer ( footer.php ) —This is the bottom of the page, containing useful, if not always widely
read, information about your blog. Your copyright notice, the theme creator, and your hosting
provider are among the items that can appear in the footer.
Sidebar ( sidebar.php ) —This includes your recent posts, blogroll, and sundry widgets to make
your blog more interesting.
All WordPress themes have these four templates; your theme might have more. The Arclite theme
has 19 page templates, covering everything from search results to comments to the message that
appears when visitors discover a dead link ( 404.php ). We just focus on the four primary templates
here.
As with your CSS file, you can use the WordPress theme editor to look at and make changes in your
PHP templates. From your Administrative page, go to Appearance, then Editor to open the theme
editor. Click any of the Template files in the right sidebar to open that template in the editor.
The Index Template
You probably know this, but just in case: Without an Index page, you don't have much of a blog.
You don't even have much of a web presence. When your would-be visitor types in the address
www.mycoolblog.com, and there's no Index page (whether that page is called index or home ), the
browser does not know what to do, and your would-be visitor gets an error message and a per-
plexed look on her face. She'll think “Oh no, another dead blog!” and quite possibly never return.
Conversely, if all you have is an Index page, and no header, sidebar, or footer area, you lose many of
the aspects of WordPress that make it such an attractive platform. A blog with no headline, or
blogroll, or way to access older posts would seem a bit empty too. There is certainly a place for
blogs missing one or more of these features, but you might not even recognize it as a weblog with
all of them missing.
This scenario is not likely to ever happen with your WordPress blog (unless of course, you don't
keep the domain registered), as the Index page pulls everything together in a nice little package.
This is done through PHP scripts sitting on your Index.php page.
If you open just about any Main Index template, the first thing you're likely to see is a call to the
header template. It looks like this, with perhaps a comment
and some line breaks:
note
get_header(); is a WordPress
template tag. You'll learn more
about these in “The Sidebar
Template” later in this chapter.
<?php get_header(); ?>
This single line of code brings the header.php file to your
blog's home page. Is this critical? Probably. Is it easy to do?
Certainly! It is not, however, the most important item on this
Search WWH ::




Custom Search