Hello, I have this code: <a href ="<?php bloginfo('url'); ?>/?author=<?php echo $comment->user_id ?>"><?php echo $comment->comment_author?></a> <?php echo gp_says; ?>
It makes a link from the name of user who submit comment, but i want this only for registered users, not for everybody. Now I have all names linked like:
if is registered user – mydomain.com/author=user_id
if not registered – mydomain.com/author=0
Is it possible to add some code to check if is user registered and only then make the name clickable?
The topic ‘Comment author name as a link to profile’ is closed to new replies.
(@fonsii)
13 years, 5 months ago
Hello, I have this code:
<a href ="<?php bloginfo('url'); ?>/?author=<?php echo $comment->user_id ?>"><?php echo $comment->comment_author?></a> <?php echo gp_says; ?>
It makes a link from the name of user who submit comment, but i want this only for registered users, not for everybody. Now I have all names linked like:
if is registered user – mydomain.com/author=user_id
if not registered – mydomain.com/author=0
Is it possible to add some code to check if is user registered and only then make the name clickable?