Conditional images for comment avatars
-
Hello,
Thank you for reading and trying to help solve this.
I have some images that I have used to show up for specific authors of comments, including myself. It all works fine.
I also have images that I want to rotate as comments are added. This also works fine.
My problem is how to work it out so that the rotating images does not go into effect for the ones I have specified for specific authors. I am not sure how to tell it when not to alternate.
Here is the php for these:
Author specific:
<?php $isByAuthor = false; if($comment->comment_author_email == '[email protected]') { $isByAuthor = true; } ?>
then:
<?php if($isByAuthor ) { echo '<div class="authorcomment">';} ?> <?php if($isByIamys ) { echo '<div class="othercomment">';} ?> <?php comment_text() ?> <?php if($isByAuthor ) { echo '</div>';} ?> <?php if($isByother ) { echo '</div>';} ?>
and for the alternating one:(as I have now so it’s disabled)
<?php /* Changes every other comment to a different class */ if ('alt' == $oddcomment) $oddcomment = ''; else $oddcomment = 'alt'; ?>
[please remember to mark any posted code – https://codex.www.ads-software.com/Forum_Welcome#Posting_Code ]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Conditional images for comment avatars’ is closed to new replies.