WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This may sound like a stupid question, but...

What are the main parts of a Wordpress template, and which parts are mandatory and which parts are optional?

So far I am aware of:

  • Posts (mandatory)
  • Pages (mandatory)
  • Page Templates (optional)
  • Tags (optional)
  • Categories (optional)
  • Search / Search Results (mandatory)
  • Archives (mandatory)
  • Widgets (optional)

Is there anything else?

share|improve this question
You need just the index.php and style.css and maybe a comments.php. Everything else is optional. Why do you think the other parts are required? – toscho Mar 8 '13 at 2:27
This is as small as a theme can be while still being able to present infomation. On the other side of the spectrum there are themes with hundreds of files. – Wyck Mar 8 '13 at 3:30
@toscho Because most templates seem to have them. – leeand00 Mar 8 '13 at 13:27
up vote 3 down vote accepted

Indeed, it is as toscho has said. index.php and style.css are the bare minumum.

Developers like to separate things, though, so instead of having one index.php file to rule all, you'll find parts like:


and additional templates like ones you mentioned in the question.

This page will show you how its done at the minimum level.

share|improve this answer

If you want to include your theme in the WordPress theme repository it should at least include:

  1. index.php
  2. comments.php
  3. style.css

This list and many other best practices can be found on the Theme Review page in the Codex.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.