[Resolved] WordPress "Comments Closed" Text Not Appearing
I’m having trouble with getting the “Comments are closed.” text to appear on a post page. The comment form goes away as desired, but the replacement text doesn’t appear. Here’s the code in my comments.php theme file. Any ideas?
<div id="comments"> <?php if ( post_password_required() ) : ?> <p>This post is password protected. Enter the password to view any comments</p> </div> <?php /* Stop the rest of comments.php from being processed, * but don't kill the script entirely -- we still have * to fully load the template. */ return; endif; ?> <?php if ( have_comments() ) : ?> <h1><?php comments_number( 'No Comments Yet', '1 Comment', '% Comments' ); ?></h1> <ol class="comments"> <?php wp_list_comments( array( 'callback' => 'starkers_comment' ) ); ?> </ol> <?php /* If there are no comments and comments are closed, let's leave a little note, shall we? * But we don't want the note on pages or post types that do not support comments. */ elseif ( ! comments_open() && ! is_page() && post_type_supports( get_post_type(), 'comments' ) ) : ?> <h1>Comments are closed</h1> <?php endif; ?> <?php comment_form(array('title_reply'=>'<h1>Share your thoughts</h1>')); ?> </div><!-- #comments -->
- The topic ‘[Resolved] WordPress "Comments Closed" Text Not Appearing’ is closed to new replies.