CHAPTER 4 • WordPress Theme Essentials 91
comment_form();
?>
CHAPTER 4 • WordPress Theme Essentials 91
comment_form();
?>
The comments within the code should help you along. What’s important here is that wp_
list_comments() is what’s outputting the actual comments. This template tag takes a few
parameters, and you can even tune the output of it using the callback parameter to point to a
function in functions.php should you want to. For your needs here, you’ll just use the default
output, which is a simple list to work with. If you want to know what you can do with
wp_list_comments(), read up on it in the Codex at http://codex.wordpress.
org/Function_Reference/wp_list_comments.
ARCHIVE TEMPLATES
There are several possible archive templates you can use in a theme. The index.php template,
when used for listing posts, is basically an archive. What kind of archive templates you want
and need in your theme depends on your type of content. The archive.php template is a
general fallback template in most themes, and you could stick with that. For categories, you’ve
got category.php, and for tags, you’ve got tag.php. There is also date.php for date archives and
so on. All available templates are listed later in this chapter in the section “Understanding
Template Files”; they all work more or less the same.
For the Simple Blog theme, you’ll settle for an archive.php template, which will be used for all
archives (rather than just have them revert to index.php), and you’ll use conditional tags to
output the correct heading for the various types of archives:
<?php get_header(); ?>