Title: Template Hierarchy
Last modified: August 19, 2016

---

# Template Hierarchy

 *  [Root](https://wordpress.org/support/users/root/)
 * (@root)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/template-hierarchy/)
 * Returning to using WP after a period in other platforms I am completely baffled
   by the template hierarchy. Can anyone kindly point me to any _upto date info 
   _on how it works ? Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/template-hierarchy/#post-1819722)
 * See [this Codex section](http://codex.wordpress.org/Theme_Development#Template_Files_List).
 *  Thread Starter [Root](https://wordpress.org/support/users/root/)
 * (@root)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/template-hierarchy/#post-1819760)
 * tx for that…………….
 *  Thread Starter [Root](https://wordpress.org/support/users/root/)
 * (@root)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/template-hierarchy/#post-1819763)
 * I guess some of the sources of my confusion are these:
    Using TwentyTen
 * First of all the theme contains a number of templates which are not referred 
   to in the template hierarchy at all namely loop.php and onecolumn-page.php.
 * Secondly if I delete all template files the theme will not run off index.php 
   as it is supposed to at all.
 * Thirdly in the Codex – which I appreciate is something of a patchwork written
   by volunteers – there is much mention of using conditional tags to act on the
   query type. What is less clear is where or how they could be used. If the query
   has already been routed to say archive.php in the theme by the template loader
   then where can a conditional be placed ?
 * This is relatively trivial……..using index.php alone – which does work partially
   it just omits the content – it outputs legacy css into the head of the document
   when there is nothing in the index to make it do so.
 * Finally the markup output for the branding is different in different templates
   which is an early gotcha as it throws out the CSS. It is wierd because presumably
   header.php only has one lot of markup in it.
 * Tx for yr help so far.
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/template-hierarchy/#post-1819802)
 * > loop.php
 * See [get_template_part](http://codex.wordpress.org/Function_Reference/get_template_part)
 * > onecolumn-page.php
 * That’s just a [custom page template](http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates).
 * > Secondly if I delete all template files the theme will not run off index.php
   > as it is supposed to at all.
 * It will do if your index.php also contains the contents of header.php, loop.php
   and footer.php.
 * > there is much mention of using conditional tags to act on the query type
 * Are you referring to [query_posts](http://codex.wordpress.org/Function_Reference/query_posts)
   or [conditional tags](http://codex.wordpress.org/Conditional_Tags)?
 *  Thread Starter [Root](https://wordpress.org/support/users/root/)
 * (@root)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/template-hierarchy/#post-1819834)
 * Ty so much. Inch by inch I am catching up. Yr help is invaluable.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Template Hierarchy’ is closed to new replies.

## Tags

 * [templates](https://wordpress.org/support/topic-tag/templates/)
 * [Themes](https://wordpress.org/support/topic-tag/themes/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 2 participants
 * Last reply from: [Root](https://wordpress.org/support/users/root/)
 * Last activity: [15 years, 4 months ago](https://wordpress.org/support/topic/template-hierarchy/#post-1819834)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
