WordPress.org

Making WordPress.org

Ticket #3156: 3156.patch

File 3156.patch, 6.1 KB (added by mp518, 3 years ago)

Placeholder

  • trunk/wordcamp.org/public_html/wp-content/themes/wordcamp-base/comments.php

     
    1313 */
    1414?>
    1515
    16                         <div id="comments">
    17 <?php if ( post_password_required() ) : ?>
    18                                 <p class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'wordcamporg' ); ?></p>
    19                         </div><!-- #comments -->
    20 <?php
    21                 /* Stop the rest of comments.php from being processed,
    22                 * but don't kill the script entirely -- we still have
    23                 * to fully load the template.
    24                 */
    25                 return;
    26         endif;
     16<div id="comments">
     17    <?php if (post_password_required()) : ?>
     18        <p class="nopassword"><?php _e('This post is password protected. Enter the password to view any comments.', 'wordcamporg'); ?></p>
     19    </div><!-- #comments -->
     20    <?php
     21    /* Stop the rest of comments.php from being processed,
     22    * but don't kill the script entirely -- we still have
     23    * to fully load the template.
     24    */
     25    return;
     26endif;
    2727?>
    2828
    2929<?php
    30         // You can start editing here -- including this comment!
     30// You can start editing here -- including this comment!
    3131?>
    3232
    33 <?php if ( have_comments() ) : ?>
    34                         <h3 id="comments-title"><?php
    35                         printf( _n( 'One Response to %2$s', '%1$s Responses to %2$s', get_comments_number(), 'wordcamporg' ),
    36                         number_format_i18n( get_comments_number() ), '<em>' . get_the_title() . '</em>' );
    37                         ?></h3>
     33<?php if (have_comments()) : ?>
     34    <h3 id="comments-title"><?php
     35       
     36        $comments_number = get_comments_number();
     37        if (1 == $comments_number) {
     38            /* translators: %s: post title */
     39            printf(_x('One Response to &ldquo;%2$s&rdquo;', 'comments title', 'wordcamporg'), '<span>' . get_the_title() . '</span>');
     40        } else {
     41            printf(
     42                    /* translators: 1: number of comments, 2: post title */
     43                    _nx(
     44                            '%1$s Response to &ldquo;%2$s&rdquo;', '%1$s Response to &ldquo;%2$s&rdquo;', $comments_number, 'comments title', 'wordcamporg'
     45                    ), number_format_i18n($comments_number), '<span>' . get_the_title() . '</span>'
     46            );
     47        }
     48        ?></h3>
    3849
    39 <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
    40                         <div class="navigation">
    41                                 <div class="nav-previous"><?php previous_comments_link( __( '<span class="meta-nav">&larr;</span> Older Comments', 'wordcamporg' ) ); ?></div>
    42                                 <div class="nav-next"><?php next_comments_link( __( 'Newer Comments <span class="meta-nav">&rarr;</span>', 'wordcamporg' ) ); ?></div>
    43                         </div> <!-- .navigation -->
    44 <?php endif; // check for comment navigation ?>
     50        <?php if (get_comment_pages_count() > 1 && get_option('page_comments')) : // Are there comments to navigate through? ?>
     51        <div class="navigation">
     52            <div class="nav-previous"><?php previous_comments_link(__('<span class="meta-nav">&larr;</span> Older Comments', 'wordcamporg')); ?></div>
     53            <div class="nav-next"><?php next_comments_link(__('Newer Comments <span class="meta-nav">&rarr;</span>', 'wordcamporg')); ?></div>
     54        </div> <!-- .navigation -->
     55        <?php endif; // check for comment navigation ?>
    4556
    46                         <ol class="commentlist">
    47                                 <?php
    48                                         /* Loop through and list the comments. Tell wp_list_comments()
    49                                         * to use twentyten_comment() to format the comments.
    50                                         * If you want to overload this in a child theme then you can
    51                                         * define twentyten_comment() and that will be used instead.
    52                                         * See twentyten_comment() in twentyten/functions.php for more.
    53                                         */
    54                                         wp_list_comments( array( 'callback' => 'twentyten_comment' ) );
    55                                 ?>
    56                         </ol>
     57    <ol class="commentlist">
     58    <?php
     59    /* Loop through and list the comments. Tell wp_list_comments()
     60    * to use twentyten_comment() to format the comments.
     61    * If you want to overload this in a child theme then you can
     62    * define twentyten_comment() and that will be used instead.
     63    * See twentyten_comment() in twentyten/functions.php for more.
     64    */
     65    wp_list_comments(array('callback' => 'twentyten_comment'));
     66    ?>
     67    </ol>
    5768
    58 <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
    59                         <div class="navigation">
    60                                 <div class="nav-previous"><?php previous_comments_link( __( '<span class="meta-nav">&larr;</span> Older Comments', 'wordcamporg' ) ); ?></div>
    61                                 <div class="nav-next"><?php next_comments_link( __( 'Newer Comments <span class="meta-nav">&rarr;</span>', 'wordcamporg' ) ); ?></div>
    62                         </div><!-- .navigation -->
    63 <?php endif; // check for comment navigation ?>
     69        <?php if (get_comment_pages_count() > 1 && get_option('page_comments')) : // Are there comments to navigate through? ?>
     70        <div class="navigation">
     71            <div class="nav-previous"><?php previous_comments_link(__('<span class="meta-nav">&larr;</span> Older Comments', 'wordcamporg')); ?></div>
     72            <div class="nav-next"><?php next_comments_link(__('Newer Comments <span class="meta-nav">&rarr;</span>', 'wordcamporg')); ?></div>
     73        </div><!-- .navigation -->
     74    <?php endif; // check for comment navigation  ?>
    6475
    65 <?php else : // or, if we don't have comments:
     76    <?php
     77else : // or, if we don't have comments:
    6678
    67         /* If there are no comments and comments are closed,
    68         * let's leave a little note, shall we?
    69         */
    70         if ( ! comments_open() ) :
    71 ?>
    72         <p class="nocomments"><?php _e( 'Comments are closed.', 'wordcamporg' ); ?></p>
    73 <?php endif; // end ! comments_open() ?>
     79    /* If there are no comments and comments are closed,
     80    * let's leave a little note, shall we?
     81    */
     82    if (!comments_open()) :
     83        ?>
     84        <p class="nocomments"><?php _e('Comments are closed.', 'wordcamporg'); ?></p>
     85    <?php endif; // end ! comments_open() ?>
    7486
    7587<?php endif; // end have_comments() ?>
    7688