Advertisement
alchymyth

commentform before comments 2012

Oct 31st, 2012
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.18 KB | None | 0 0
  1. <?php
  2. /**
  3.  * The template for displaying Comments.
  4.  *
  5.  * The area of the page that contains both current comments
  6.  * and the comment form. The actual display of comments is
  7.  * handled by a callback to twentytwelve_comment() which is
  8.  * located in the functions.php file.
  9.  *
  10.  * @package WordPress
  11.  * @subpackage Twenty_Twelve
  12.  * @since Twenty Twelve 1.0
  13.  */
  14.  
  15. /*
  16.  * If the current post is protected by a password and
  17.  * the visitor has not yet entered the password we will
  18.  * return early without loading the comments.
  19.  */
  20. if ( post_password_required() )
  21.     return;
  22. ?>
  23.  
  24. <div id="comments" class="comments-area">
  25.  
  26.     <?php comment_form(); // for commentform before the comments ?>
  27.  
  28.     <?php // You can start editing here -- including this comment! ?>
  29.  
  30.     <?php if ( have_comments() ) : ?>
  31.         <h2 class="comments-title">
  32.             <?php
  33.                 printf( _n( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'twentytwelve' ),
  34.                     number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
  35.             ?>
  36.         </h2>
  37.  
  38.         <ol class="commentlist">
  39.             <?php wp_list_comments( array( 'callback' => 'twentytwelve_comment', 'style' => 'ol' ) ); ?>
  40.         <!-- .commentlist -->
  41.  
  42.         <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
  43.         <nav id="comment-nav-below" class="navigation" role="navigation">
  44.             <h1 class="assistive-text section-heading"><?php _e( 'Comment navigation', 'twentytwelve' ); ?></h1>
  45.             <div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'twentytwelve' ) ); ?></div>
  46.             <div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'twentytwelve' ) ); ?></div>
  47.         </nav>
  48.         <?php endif; // check for comment navigation ?>
  49.  
  50.     <?php // If comments are closed and there are comments, let's leave a little note.
  51.         elseif ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
  52.     ?>
  53.         <p class="nocomments"><?php _e( 'Comments are closed.', 'twentytwelve' ); ?></p>
  54.     <?php endif; ?>
  55.  
  56.     <?php // comment_form(); // for commentform after the comments ?>
  57.  
  58. </div><!-- #comments .comments-area -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement