WordPress.org

Making WordPress.org


Ignore:
Timestamp:
05/24/2015 08:06:47 PM (4 years ago)
Author:
ocean90
Message:

Rosetta Theme: Responsive and other improvements.

  • Add template for 404 error.
  • Add template for front page which was previously the index template.
  • Update index template to support static front page and page for posts.
  • Update comments template to use wp_list_comments() and comment_form().
  • Update styling of blog posts.

see #1049.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/global.wordpress.org/public_html/wp-content/themes/rosetta/comments.php

    r1560 r1615  
    1 <?php if ( $comments ) : ?>
    2 <h2 id="commentheader" class="fancy"><?php _e('Comments', 'rosetta'); ?></h2>
    3 <ol id="comments" class="commentlist">
    4     <?php foreach ($comments as $comment) : ?>
    5         <li id="comment-<?php comment_ID() ?>" class="comment">
    6             <div class="narrow">
    7                 <span class="author"><?php comment_author_link(); ?></span>
    8                 <span class="date"><?php comment_date(__('F j, Y', 'rosetta')) ?>,&nbsp;<?php comment_time(__('g:i a', 'rosetta')) ?></span>
    9                 <span class="permlink"><a href="#comment-<?php comment_ID() ?>" title="<?php esc_attr_e('Permanent link to this comment', 'rosetta'); ?>">#</a></span>
    10                 <?php edit_comment_link(__("Edit&nbsp;This", 'rosetta'), ''); ?>
    11             </div>
    12             <div class="wide">
    13                 <?php comment_text() ?>
    14             </div>
    15         </li>
    16     <?php endforeach; ?>
    17 </ol>
    18 <?php endif; ?>
     1<?php
     2/*
     3 * If the current post is protected by a password and
     4 * the visitor has not yet entered the password we will
     5 * return early without loading the comments.
     6 */
     7if ( post_password_required() ) {
     8    return;
     9}
     10?>
    1911
    20 <?php if ( comments_open() ) : ?>
     12<div id="comments" class="comments-area">
    2113
    22 <form id="commentform" action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post">
    23     <h3><?php _e('Add a Comment', 'rosetta'); ?></h3>
     14    <?php if ( have_comments() ) : ?>
     15        <h2 class="comments-title">
     16            <?php
     17                printf( _nx( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'rosetta' ),
     18                    number_format_i18n( get_comments_number() ), get_the_title() );
     19            ?>
     20        </h2>
    2421
    25     <?php if ( $user_ID ) : ?>
     22        <ol class="comment-list">
     23            <?php
     24                wp_list_comments( array(
     25                    'style'       => 'ol',
     26                    'short_ping'  => true,
     27                    'avatar_size' => 56,
     28                ) );
     29            ?>
     30        </ol>
    2631
    27     <div id="loggedin"><?php printf(__('Logged in as %s.', 'rosetta'), '<a href="' . admin_url( 'profile.php' ) .'">'.$user_identity.'</a>'); ?> <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="<?php esc_attr_e('Log out of this account.', 'rosetta') ?>"><?php _e('Logout &raquo;', 'rosetta'); ?></a></div>
     32    <?php endif; ?>
    2833
    29     <?php else : ?>
     34    <?php
     35        // If comments are closed and there are comments, let's leave a little note, shall we?
     36        if ( ! comments_open() && get_comments_number() ) :
     37    ?>
     38        <p class="no-comments"><?php _e( 'Comments are closed.', 'rosetta' ); ?></p>
     39    <?php endif; ?>
    3040
    31     <div class="narrow">
    32         <input id="author" name="author" type="text" value="<?php echo esc_attr( $comment_author ) ?>" tabindex="1" />
    33         <label for="author"><?php _e('Name <em>(required)</em>', 'rosetta') ?></label>
     41    <?php comment_form(); ?>
    3442
    35         <input id="email" name="email" type="text" value="<?php echo esc_attr( $comment_author_email ) ?>" tabindex="2" />
    36         <label for="email"><?php _e('Email <em>(required)</em>', 'rosetta') ?></label>
    37 
    38         <input id="url" name="url" type="text" value="<?php echo esc_attr( $comment_author_url ) ?>" tabindex="3" />
    39         <label for="url"><?php _e('Web Site', 'rosetta') ?></label>
    40     </div>
    41 
    42 <?php endif; ?>
    43 
    44     <div class="wide">
    45         <textarea id="comment" name="comment" cols="45" rows="8" tabindex="4"></textarea>
    46         <input id="submit" name="submit" type="submit" value="<?php esc_attr_e('Post Comment &raquo;', 'rosetta') ?>" tabindex="5" /><input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
    47     </div>
    48 
    49 <?php do_action('comment_form', $post->ID); ?>
    50 
    51 </form> <!-- end commentform -->
    52 
    53 <?php else : // Comments are closed ?>
    54 <?php endif; ?>
     43</div>
Note: See TracChangeset for help on using the changeset viewer.