In the case of categories, the hierarchy is fairly simple. For instance,
suppose the slug of the Category in question is default and the Category
ID is 6. The Template Hierarchy specifies that WordPress will use the
first Template file it finds in your current Theme’s directory from the
following list:
1. category-slug.php (Note: available with Version 2.9)
2. category-ID.php
3. category.php
4. archive.php
5. index.php
That is, if you do not have a category-slug.php (lets say
category-news.php), WordPress will check for a category-ID.php (like
category-6.php), and so on.
So, if you want to make the Category whose ID number is 6 look different
from what it is currently (and different from other Category pages), you
would want to create a category-6.php file. If you want to make all
Category pages look different from other archive pages (such as date and
author archives), then you would want to create or modify the
category.php file. If you want to make changes to the look of all
archive pages, you can create or modify the archive.php file. And if you
modify the index.php file, you will affect your entire blog.
If you need to create a new file, it is a good idea to copy it from the
next file in the hierarchy that exists. For instance, if you want a
special display for Category 6, begin by copying the category.php file,
or if you don’t have one, use archive.php, and so on.
–
Dwayne Myers
(386)307-4289
Http://www.DreamDrivenDesigns.com
Leave a Comment
- « Older Entries
- Newer Entries »