Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

When I hover over the comment author link on my comments, it shows a link like http://mysitenameeeee.com/?author=24

After I click it, it gets me to /author/authorname, which is fine, but I don't want the link to be author=24 when I hover it. If I hover the post author link, it shows me the correct link to author.php. What is the difference, why and how can I solve it?

Here is the snippet:

<a rel="author" href ="<?php bloginfo('url'); ?>/?author=<?php echo $comment->user_id ?>"><?php echo $comment->comment_author?></a>
share|improve this question
    
How to fix it? Idk if you can change that. Wordpress assigns the user id number to users who have not posted, and uses the user name for users who have posted. (posted ie: written a post). –  Ronburgundy Jul 20 '13 at 14:44
    
I think this is a duplicate of wordpress.stackexchange.com/questions/94565/… – do you agree? –  toscho Jul 20 '13 at 15:07
add comment

1 Answer

up vote 0 down vote accepted

Use get_comment_author_link() instead of <a href … </a>:

echo get_comment_author_link();
share|improve this answer
    
Edit. Got it to work by adding /author/ in the href. Thanks mate! –  Johan Jul 20 '13 at 15:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.