The Word Press template hierarchy

Need to work with the theme a bit? Understanding the Template Hierarchy can really help you create the view you need with minimal programming headaches. The following list contains the general template hierarchy's rules. The absolute simplest theme you can have must contain an index.php page. If no other specific template pages exist, then index.php is the default.

You can then begin expanding your theme by adding the following pages:

archive.php trumps index.php when a category, tag, date, or author page is viewed.

home.php trumps index.php when the home page is viewed.

single.php trumps index.php when an individual post is viewed.

search.php trumps index.php when the results from a search are viewed.

4 04.php trumps index.php, when the URI address finds no existing content.

page.php trumps index.php when looking at a static page.

° A custom template page, such as: page_about.php, when selected through the page's Administration panel, trumps page.php, which trumps index.php when that particular page is viewed.

category.php trumps archive.php. This then trumps index.php when a category is viewed.

° A custom category-ID page, such as: category-i2.php trumps category.php. This then trumps archive.php, which trumps index.php.

tag.php trumps archive.php. This in turn trumps index.php when a tag page is viewed.

° A custom tag-tagname page, such as: tag-reviews.php trumps tag.php. This trumps archive.php, which trumps index.php.

author.php trumps archive.php. This in turn trumps index.php, when an author page is viewed.

date.php trumps archive.php, This trumps index.php when a date page is viewed.

date.php trumps archive.php, This trumps index.php when a date page is viewed.

http://codex.wordpress.org/Template_Hierarchy."/>
You can learn more about the WordPress theme template hierarchy here: http://codex.wordpress.org/Template_Hierarchy.

Was this article helpful?

0 0
Blogging For Business

Blogging For Business

Download this Guide And Discover How Start And Run Your Very Own Successful Business Blog. Always Wanted To Start Your Own Blog?

Get My Free Ebook


Post a comment