Advertisement
Guest User

comments.php

a guest
Nov 13th, 2011
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.19 KB | None | 0 0
  1. application/x-httpd-php comments.php
  2. PHP script text
  3.  
  4. <?php
  5. /**
  6.  * The template for displaying Comments.
  7.  *
  8.  * The area of the page that contains both current comments
  9.  * and the comment form. The actual display of comments is
  10.  * handled by a callback to twentyeleven_comment() which is
  11.  * located in the functions.php file.
  12.  *
  13.  * @package WordPress
  14.  * @subpackage Twenty_Eleven
  15.  * @since Twenty Eleven 1.0
  16.  */
  17. ?>
  18.     <div id="comments">
  19.     <?php if ( post_password_required() ) : ?>
  20.         <p class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'twentyeleven' ); ?></p>
  21.     </div><!-- #comments -->
  22.     <?php
  23.             /* Stop the rest of comments.php from being processed,
  24.              * but don't kill the script entirely -- we still have
  25.              * to fully load the template.
  26.              */
  27.             return;
  28.         endif;
  29.     ?>
  30.  
  31.     <?php // You can start editing here -- including this comment! ?>
  32.  
  33.     <?php if ( have_comments() ) : ?>
  34.         <h2 id="comments-title">
  35.             <?php
  36.                 printf( _n( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'twentyeleven' ),
  37.                     number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
  38.             ?>
  39.         </h2>
  40.  
  41.         <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
  42.         <nav id="comment-nav-above">
  43.             <h1 class="assistive-text"><?php _e( 'Comment navigation', 'twentyeleven' ); ?></h1>
  44.             <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'twentyeleven' ) ); ?></div>
  45.             <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'twentyeleven' ) ); ?></div>
  46.         </nav>
  47.         <?php endif; // check for comment navigation ?>
  48.  
  49.         <ol class="commentlist">
  50.             <?php
  51.                 /* Loop through and list the comments. Tell wp_list_comments()
  52.                  * to use twentyeleven_comment() to format the comments.
  53.                  * If you want to overload this in a child theme then you can
  54.                  * define twentyeleven_comment() and that will be used instead.
  55.                  * See twentyeleven_comment() in twentyeleven/functions.php for more.
  56.                  */
  57.                 wp_list_comments( array( 'callback' => 'twentyeleven_comment' ) );
  58.             ?>
  59.         </ol>
  60.  
  61.         <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
  62.         <nav id="comment-nav-below">
  63.             <h1 class="assistive-text"><?php _e( 'Comment navigation', 'twentyeleven' ); ?></h1>
  64.             <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'twentyeleven' ) ); ?></div>
  65.             <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'twentyeleven' ) ); ?></div>
  66.         </nav>
  67.         <?php endif; // check for comment navigation ?>
  68.  
  69.     <?php
  70.         /* If there are no comments and comments are closed, let's leave a little note, shall we?
  71.          * But we don't want the note on pages or post types that do not support comments.
  72.          */
  73.         elseif ( ! comments_open() && ! is_page() && post_type_supports( get_post_type(), 'comments' ) ) :
  74.     ?>
  75.         <p class="nocomments"><?php _e( 'Comments are closed.', 'twentyeleven' ); ?></p>
  76.     <?php endif; ?>
  77.  
  78.     <?php comment_form(); ?>
  79.  
  80. </div><!-- #comments -->
  81.  
  82.  
  83.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement