WordPress.org

Support

Support » Themes and Templates » Alternate & Admin Comments

Alternate & Admin Comments

  • 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.

  • The topic ‘Alternate & Admin Comments’ is closed to new replies.