WordPress.org

Make WordPress Core

Changeset 4922


Ignore:
Timestamp:
02/23/2007 12:55:52 AM (11 years ago)
Author:
ryan
Message:

Don't emit empty class. Props rob1n. fixes #3787

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/default/comments.php

    r4901 r4922  
    1515
    1616    /* This variable is for alternating comment background */
    17     $oddcomment = 'alt';
     17    $oddcomment = 'class="alt" ';
    1818?>
    1919
     
    2727    <?php foreach ($comments as $comment) : ?>
    2828
    29         <li class="<?php echo $oddcomment; ?>" id="comment-<?php comment_ID() ?>">
     29        <li <?php echo $oddcomment; ?>id="comment-<?php comment_ID() ?>">
    3030            <cite><?php comment_author_link() ?></cite> Says:
    3131            <?php if ($comment->comment_approved == '0') : ?>
     
    4040        </li>
    4141
    42     <?php /* Changes every other comment to a different class */
    43         if ('alt' == $oddcomment) $oddcomment = '';
    44         else $oddcomment = 'alt';
     42    <?php
     43        /* Changes every other comment to a different class */
     44        $oddcomment = ( empty( $oddcomment ) ) ? 'class="alt" ' : '';
    4545    ?>
    4646
Note: See TracChangeset for help on using the changeset viewer.