WordPress.org

Ready to get started?Download WordPress

Forums

Minimal Set of Template Files (4 posts)

  1. Ben B
    Member
    Posted 4 years ago #

    I tend to use WP to create CMS-style sites, rather than blogs. My way of working is to get everything I need into page.php (incl. sidebars, header, footer) and work from there. The problem comes when I split this back out to each individual files. Using Sandbox as a starting point, there's 13 or so files for content.

    I know that a theme requires only an index.php; but working practically -- and using the template hierarchy -- would it be worthwhile only using these files to display everything --

    • archive.php
    • home.php
    • page.php
    • search.php
    • 404.php
    • single.php

    In your practical experience, would this be a good trade-off between using the 13 content presentation files; and a single index.php with loads of conditionals?

    Any insight into theme development like this is appreciated.

    Sincerely

    Ben

  2. Durgé Seerden
    Member
    Posted 4 years ago #

    I would recommendt using header.php, footer.php and if u use a sidebar sidebar.php and include them in all of your files. Then just use the template files you need. If a single page needs a other structure then the index.php create page.php, if a single post needs different structure use single.php and so on.

    Just use the files that you need there is no point in having a page.php if it's exactly the same as index.php.

    Hope this will help you further.

    Greetz,

    Durgé
    Dimics.com

  3. Ben B
    Member
    Posted 4 years ago #

    Thanks Durgé, I should have said I would expect to always use header.php, footer.php and sidebar.php. It's obvious one you said it, but perhaps I should start with just index.php and see where I need additional controls and drop that new template in.

    Anyone else?

  4. Peter Boosten
    Member
    Posted 4 years ago #

    actually, two files are mandatory: style.css and index.php

    You can build your entire site on these two files.

    Peter

Topic Closed

This topic has been closed to new replies.

About this Topic