Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

WordPress has minimum theme template files as

  • style.css
  • index.php

and also some other files as listed here.

If the theme developer wants to build theme with less bells and whistles, what are some of the template files which should be included at minimum? There isn't any guidelines in the WordPress docex. Only thing that you can find is what files and when to include them. For making use of most of the wordpress functions without any conflict, there doesn't seem to be specific number mentioned for number of template files.

So how many files should be there when you build a theme from say raw html template?

share|improve this question
add comment

2 Answers 2

up vote 5 down vote accepted

To have the theme listed:

  • style.css

With at minimum this:

/*   
Theme Name: Minimum Theme
Description: Test
Author: Test
Version: 1.0
*/

For the theme to be functional:

  • index.php

index.php must have a post loop, so this would be the bare minimum functional index.php

<html>
<head><?php wp_head(); ?></head>
<body>
<?php
if ( have_posts() ) {
    while ( have_posts() ) {
        the_post();
        the_title( '<h3>', '</h3>' );
        the_content();
    }
}
wp_footer();
?>
</body>
</html>

index.php is the defacto fallback for all template files WordPress might look for. All the rest are entirely optional, though I advise that you use them.

For more information on which templates are possible, see here:

http://codex.wordpress.org/Template_Hierarchy

share|improve this answer
    
Thanks, I take that for the minimal themes, additional files can be clutter? :) –  Ryu Ishida Feb 1 '13 at 12:49
    
Not necessarily, it all depends what you need and what you're trying to do –  Tom J Nowell Feb 1 '13 at 14:37
add comment

two - styles.css and index.php if you gonna add additional functionality (some filters or actions) add to list functions.php if you gonna add additional tempaltes + number of tempaltes add screenshot of your theme + screnshot.(jpeg|png|gif)

it all depands of you. but minimun requirments - style.css and index.php

share|improve this answer
add comment

Your Answer

 
discard

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.