Required Template Files | WordPress

Required Template Files #
style.css

Your theme’s main stylesheet file. This file will also include information about your theme, such as author name, version number, and plugin URL, in it’s header.

index.php

The main template file for your theme. This will be the template for the homepage on your site unless a static front page is specified.

header.php

Contains metadata for your theme, include a doucment’s type stylesheets, pingback, feed information and meta tags. This file will also include the wp_head(); call just before the closing </head> HTML tag.

footer.php

Used to close <body> and <hhtml> tags and can also be used to create a universal footer. Includes the wp_footer(); call just above the closing body tag.

sidebar.php

Themes should be widgetized, and widgets should be included in the sidebar. Any default widgets can be placed in this file, though they should be disabled when new widgets are activated by the user in Appearance > Widgets.

single.php

Default template for posts, when a single post is queried. Can display post title, date, conent, author names and other pertinent post information, metadata and comments.

page.php

Default template for pages, when a single page is queried. Similar to php but specific to the “Page” post type.

archive.php

Default template for archive pages, including category, tag, date and author archives. Typically includes post listing and pagination. This will also act as the archive page for any custom post types, unless another archive-{post-type}.php file is specified.

comments.php

Comment template to be included in post and page template files. Should provide support for threaded comments, trackbacks and should style author comments differently then user comments.

search.php

Template for search results. Displays a list of posts corresponsing to a user’s search. Recommended to include the user’s search query using get_search_query();. Should also include a fallback for when no search results are found, after your main loop, such as

<?php else: ?>
<p><?php echo _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.'); ?></p>
<?php endif; ?>