WordPress.org

Ready to get started?Download WordPress

Forums

Alternate & Admin Comments (1 post)

  1. ameriblog
    Member
    Posted 7 years ago #

    On my comments section, I'd like, if possible to have the styles of each comment to alternate. I'd also like to have an admin style for comments that differ from both.

    Right now my code is:

    <?php foreach ($comments as $comment) : ?>
    	<div class="comment" id="comment-<?php comment_ID() ?>">
    		<p class="author"><?php comment_author_link() ?> <em>adds:</em></p>
    		<p><?php comment_text() ?></p>
    		<p class="small"><?php comment_date() ?></p>
    	</div>
    <?php endforeach; ?>

    I'd like for it to be:

    <?php foreach ($comments as $comment) : ?>
    	<div class="comment" id="comment-<?php comment_ID() ?>">
    		<p class="author"><?php comment_author_link() ?> <em>adds:</em></p>
    		<p><?php comment_text() ?></p>
    		<p class="small"><?php comment_date() ?></p>
    	</div>
    	<div class="commentalt" id="comment-<?php comment_ID() ?>">
    		<p class="author"><?php comment_author_link() ?> <em>adds:</em></p>
    		<p><?php comment_text() ?></p>
    		<p class="small"><?php comment_date() ?></p>
    	</div>
    	<div class="comment" id="comment-<?php comment_ID() ?>">
    		<p class="author"><?php comment_author_link() ?> <em>adds:</em></p>
    		<p><?php comment_text() ?></p>
    		<p class="small"><?php comment_date() ?></p>
    	</div>
    <?php endforeach; ?>

    Also, I'd like to use a commentadmin style for if the quote was posted by an admin. Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic