Support » Themes and Templates » Minimal Set of Template Files

  • 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.



Viewing 3 replies - 1 through 3 (of 3 total)
  • 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.



    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?

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

    You can build your entire site on these two files.


Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Minimal Set of Template Files’ is closed to new replies.