WordPress.org

Ready to get started?Download WordPress

Forums

Template Hierarchy (6 posts)

  1. Root
    Member
    Posted 3 years ago #

    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.

  2. esmi
    Forum Moderator
    Posted 3 years ago #

  3. Root
    Member
    Posted 3 years ago #

    tx for that................

  4. Root
    Member
    Posted 3 years ago #

    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.

  5. esmi
    Forum Moderator
    Posted 3 years ago #

    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?

  6. Root
    Member
    Posted 3 years ago #

    Ty so much. Inch by inch I am catching up. Yr help is invaluable.

Topic Closed

This topic has been closed to new replies.

About this Topic