WordPress.org

Ready to get started?Download WordPress

Forums

Comments do not appear on all posts (4 posts)

  1. IlanK
    Member
    Posted 1 year ago #

    Not all of my posts have the option to leave comments. Comments are however enabled on all of them.

    This only happened after I was screwing around with the php.

    Could someone help me identify the problem?

    The website is http://www.payitforwardfriends.com

    <?php if ( post_password_required() ) : ?>
    				<p><?php _e( 'This post is password protected. Enter the password to view any comments.', 'ari' ); ?></p>
    <?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
    	// You can start editing here -- including this comment!
    ?>
    
    <div id="comments-content" class="clearfix">
    
    <?php if ( have_comments() ) : ?>
    
    			<h3 id="comments"><?php
    			printf( _n( 'One Comment', 'Comments (%1$s)', get_comments_number(), 'ari' ),
    			number_format_i18n( get_comments_number() ), '' . get_the_title() . '' );
    			?></h3>
    
    			<ol class="commentlist">
    				<?php wp_list_comments( array( 'callback' => 'ari_comment' ) ); ?>
    			</ol>
    
    <?php comment_form(
    array(
    	'title_reply' => __( 'Leave a Reply', 'ari' ),
    	'comment_notes_before' =>__( '<p class="comment-notes">Required fields are marked <span class="required">*</span></p>', 'ari'),
    	'comment_notes_after' => '',
    	'comment_field'  => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun', 'ari' ) . '</label><br/><textarea 
    
    id="comment" name="comment" rows="8" 	aria-required="true"></textarea></p>',
    )
    ); ?>
    
    <div class="emailmarg">Click <a href="http://feedburner.google.com/fb/a/mailverify?uri=IronWhisk" target="_blank" class="emailsub">here</a> to 
    
    subscribe to future posts by email.</div>
    <br>
    
    <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
    				<p class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'ari') ); ?></p>
    				<p class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'ari') ); ?></p>
    
    <?php endif; // check for comment navigation ?>
    
    <?php endif; // end have_comments() ?>
    
    </div>
    <!--end Comments Content-->
  2. keesiemeijer
    moderator
    Posted 1 year ago #

    Try it with this: http://pastebin.com/7BYdRMUq
    You changed it so you could only make comments when there were comments present.

  3. IlanK
    Member
    Posted 1 year ago #

    Thanks, that worked.

  4. keesiemeijer
    moderator
    Posted 1 year ago #

    No problem. I'm glad you got it resolved :-)

Topic Closed

This topic has been closed to new replies.

About this Topic