Support » Fixing WordPress » 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

    (@esmi)

    Forum Moderator

    tx for that…………….

    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

    (@esmi)

    Forum Moderator

    loop.php

    See get_template_part

    onecolumn-page.php

    That’s just a custom page template.

    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 or conditional tags?

    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.