Comment Styling with 3 or more styles (using array)?
-
Hello,
I’m using theme Twenty Ten. I have already created the CSS for the styling and it is good. I have seen it done once with styles that were over 3 different types, but can not find that blog again. I am trying to create a loop/array of comment styles.
Because it is set to odd comments it can only alternate between two. I need to find some other method. Any ideas on how to proceed.
Here is the current alternating code below.
—————
<?php if ($comments) : ?> <h3 id="comments"><?php comments_number('No Responses', 'One Response', '% Responses' );?> to “<?php the_title(); ?>”</h3> <ol class="commentlist"> <?php foreach ($comments as $comment) : ?> <div class="<?=($i%2)?"img2comment":"img1comment";$i++;?>"> <?php $isByAuthor = false; if($comment->comment_author_email == 'email1') { $isByAuthor = true; } ?> <?php $isByauthor2 = false; if($comment->comment_author_email == 'email2') { $isByauthor2 = true; } ?>
————————–
you can see it here: https://artandillumination.com/2012/black-swamp-arts-festival-gearing-up-for-20th/From there I would like to find a way to stop the loop/array if made by specific author.
Thanks for your help!!!!
- The topic ‘Comment Styling with 3 or more styles (using array)?’ is closed to new replies.