• Hi all. I have a WordPress site set up to display comments as “Anonymous User” by hard coding it into the comments.php file. I would like to have it say the user’s Username next to their comment and ONLY display that Username to THEM. In other words, if they’re a guest, they’ll see “Anonymous User” and if they’re a registered/logged in DIFFERENT user, they’ll still see “Anonymous User”, but if it’s THEIR comment it’ll say “Your Comment” or their own username. Any clue on a snippet of code? Here’s what I have so far:

    Anonymous User: <div class="post-txt" id="<?php comment_ID() ?>"><?php comment_text() ?></div>

    Thanks!

  • The topic ‘Display username to logged in user only?’ is closed to new replies.