WordPress.org

Ready to get started?Download WordPress

Forums

A question... Post table & page template (6 posts)

  1. stvcg00
    Member
    Posted 3 years ago #

    Hi =O)

    have been working in word press for about 6 months and I am just curious. Why is the data for the post or page template stored in a different table then wp_posts? Why not just create an extra column called template? and then store "index.php", "single.php", "archive.php"?

    Doing so would then allow you to version templates with the pages and advanced users can write quires that retrieve posts specific to a particular template with few sql statements?

    Thanks! =O)

  2. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    Post archives use a strict hierarchy to determine what template file to use. Only Pages use custom templates.

  3. stvcg00
    Member
    Posted 3 years ago #

    Hi esmi...

    Thanks for the reply... can you clarify what you mean by "strict hierarchy to determine what template file to use"? Are you referring to posts using the "comments.php" and other theme files that relate to threads?

    If so this brings up another question... why make those theme template files? Why not make the PHP class therefore one could just reference them from a library and then instantiate the class when needed... sort of like code ignitor?

    Thanks! =O)

  4. stvcg00
    Member
    Posted 3 years ago #

    thanks... I guess the template hierarchy is so themes can handle one off pages or pages that are slightly unique in behavior...

    That is kind of a bummer... =T in future versions i was hoping it would evolve so plug panels could load based on the selected template...

    I find my authors get over very whelmed by all the custom fields and plug panels... It would be great if I could just reference the theme file name in the default loop data... therefore I can show the panels that are important to that theme template...

  5. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.