• Resolved Pedro Lopes

    (@orion1217)


    Hi everyone,

    When someone posts a comment on our blog, the url on his nickname goes to his webpage, right?

    But I want it to go to is profile page on my website, that of course if he posted the comment when he was logged-in…

    If someone posts the comment without being logged-in they will be able to insert their url, then.

    Anyway of doing that?

    Thanks,
    Pedro Lopes

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Pedro Lopes

    (@orion1217)

    After a little bit of thinking I came up with this, and it works perfectly! 😉

    <?php
       if ($comment->user_id == '0') {
          echo comment_author_link();
       } else {
          $user_info = get_userdata($comment->user_id);
          echo "<a href='" . get_option('siteurl') . "/author/" . $user_info->user_login . "'>" . $comment->comment_author . "</a>";
       }
    ?>

    🙂

    thanks! passed on the code to a friend looking for this.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Author page link on comments’ is closed to new replies.