Click to See Complete Forum and Search --> : WordPress $comment_author_email


Moldarin
12-13-2006, 02:51 PM
WordPress 2.0

This is how WordPress outputs users's e-mail addresses if stored in current browser's cache:

<?php echo($comment_author_email); ?>

But I want to echo an alternate if there is no comment author e-mail available.

<?php if ($comment_author_email = true;) { echo($comment_author_email); } else { echo("example@runbox.com"); } ?>
That does not work though. Other suggestions?

Zipline
12-14-2006, 07:52 AM
I would adjust your code. You have a single = where you need a double == but I would do it like this anyway:


<?php if(!empty($comment_author_email)) { echo($comment_author_email); } else { echo("example@runbox.com"); } ?>