CHAPTER 4 • WordPress Theme Essentials 89
instead, but that’s not the case here. In content-single.php, you’ll wrap the post meta part in a
conditional tag, is_single(), that returns true only if you’re viewing any sort of single
post of a post type. This includes attachments but not pages.
Here’s the updated content-single.php:
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
endif;
endif; ?>
// The content
the_content();
?>
So what about the comments, then? Well, you need to use comments.php, which is the template
file used to style your comments. The following is an altered version of the comments.php file
that ships with Twenty Eleven (http://wordpress.org/themes/twentyeleven),
ready for styling:
// Is the post password protected?
if ( post_password_required() ) : ?>
This post is password protected. Please enter your password.