• Right this is the slice of code that is used for my comments.

    <li>
       		<div class="meta">
       			<?php echo get_avatar($comment,$size='70',$default='<path_to_url>' ); ?>
       			<?php printf(__('<cite class="fn">%s</cite>'), get_comment_author_link()) ?>
    
            	</div><!-- /meta -->
       		<div class="shout">
    			<?php comment_text() ?>
              </div>
    	<?php
            }

    On the top <li> I want to add an IF statement to compare the author of the article to the comment author.

    I’ve tried adding

    <li <?php
    				if (comment_author() == the_author())
    				{
    				echo " class=\"author\"";
    				}
    				?>>

    But all it does it output

    <li commentauthor theauthor>

    commentauthor would be the comments authors name and theauthor would be the authors name.

    Any help?

Viewing 1 replies (of 1 total)
  • Thread Starter thelastknight

    (@thelastknight)

    I tried this

    <li<?php if ($comment->comment_author_email == "myemail@example.com") { ?> class="authorcomment"<?php } ?>>

    Which works, but obviously that is a defined email. So I thought just change it to this.

    <li<?php if ($comment->comment_author_email == the_author_email) { ?> class="authorcomment"<?php } ?>>

    But nothing?

Viewing 1 replies (of 1 total)
  • The topic ‘How do I write this IF statement?’ is closed to new replies.