Advertisement
Guest User

Wordpress comments.php

a guest
Nov 6th, 2013
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.03 KB | None | 0 0
  1. <?php
  2. /**
  3.  * @package WordPress
  4.  * @subpackage Default_Theme
  5.  */
  6.  
  7. // Do not delete these lines
  8.     if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
  9.         die (esc_html__('Please do not load this page directly. Thanks!','AskIt'));
  10.  
  11.     if ( post_password_required() ) { ?>
  12.  
  13. <p class="nocomments"><?php esc_html_e('This post is password protected. Enter the password to view comments.','AskIt') ?></p>
  14. <?php
  15.         return;
  16.     }
  17. ?>
  18. <!-- You can start editing here. -->
  19.  
  20. <div id="comment-wrap">
  21.  
  22.     <?php if ( have_comments() ) : ?>
  23.  
  24.         <h3 id="comments"><?php esc_html_e('Community Answers','AskIt'); ?></h3>
  25.  
  26.         <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
  27.             <div class="comment_navigation_top clearfix">
  28.                 <div class="nav-previous"><?php previous_comments_link( __( '<span class="meta-nav">&larr;</span> Older Comments', 'AskIt' ) ); ?></div>
  29.                 <div class="nav-next"><?php next_comments_link( __( 'Newer Comments <span class="meta-nav">&rarr;</span>', 'AskIt' ) ); ?></div>
  30.             </div> <!-- .navigation -->
  31.         <?php endif; // check for comment navigation ?>
  32.  
  33.         <?php if ( ! empty($comments_by_type['comment']) ) : ?>
  34.             <ol class="commentlist clearfix">
  35.                 <?php wp_list_comments( array('type'=>'comment','callback'=>'et_custom_comments_display') ); ?>
  36.             </ol>
  37.         <?php endif; ?>
  38.  
  39.         <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
  40.             <div class="comment_navigation_bottom clearfix">
  41.                 <div class="nav-previous"><?php previous_comments_link( __( '<span class="meta-nav">&larr;</span> Older Comments', 'AskIt' ) ); ?></div>
  42.                 <div class="nav-next"><?php next_comments_link( __( 'Newer Comments <span class="meta-nav">&rarr;</span>', 'AskIt' ) ); ?></div>
  43.             </div> <!-- .navigation -->
  44.         <?php endif; // check for comment navigation ?>
  45.  
  46.         <?php if ( ! empty($comments_by_type['pings']) ) : ?>
  47.             <div id="trackbacks">
  48.                 <h3 id="trackbacks-title"><?php esc_html_e('Trackbacks/Pingbacks','AskIt') ?></h3>
  49.                 <ol class="pinglist">
  50.                     <?php wp_list_comments('type=pings&callback=et_list_pings'); ?>
  51.                 </ol>
  52.             </div>
  53.         <?php endif; ?>
  54.     <?php else : // this is displayed if there are no comments so far ?>
  55.        <div id="comment-section" class="nocomments">
  56.           <?php if ('open' == $post->comment_status) : ?>
  57.              <!-- If comments are open, but there are no comments. -->
  58.  
  59.           <?php else : // comments are closed ?>
  60.              <!-- If comments are closed. -->
  61.                 <div id="respond">
  62.  
  63.                 </div> <!-- end respond div -->
  64.           <?php endif; ?>
  65.        </div>
  66.     <?php endif; ?>
  67.     <?php if ('open' == $post->comment_status) : ?>
  68.         <?php comment_form( array('label_submit' => esc_attr__( 'Submit Comment', 'AskIt' ), 'title_reply' => '<span>' . esc_attr__( 'Leave a Comment', 'AskIt' ) . '</span>', 'title_reply_to' => esc_attr__( 'Leave a Reply to %s' )) ); ?>
  69.     <?php else: ?>
  70.  
  71.     <?php endif; // if you delete this the sky will fall on your head ?>
  72.  
  73. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement