How would I wrap this in an “if” statement
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘How would I wrap this in an “if” statement’ is closed to new replies.
Home / Fixing WordPress / How would I wrap this in an “if” statement
figured it out! here it is in case others are interested:
<?php if ($comment->user_id) { ?>
<a href="?author=<?php echo $comment->user_id ?>"><?php comment_author() ?></a>
<?php } ?>
argh. I spoke too soon.
Try if (!empty($comment->user_id))
.
(@mark_i)
16 years, 5 months ago
For my registered commenters, I’d like to add this link to my comment template:
<a href="?author=<?php echo $comment->user_id ?>"><?php comment_author() ?></a>
What would I put around that code so that the link only appears for comments left by registered users?
I still want others to be able to comment, but I’d like this link to appear for the comments left by registered users.
Thanks!