• Resolved Robin

    (@nioriaa)


    When the author replies to comments, the author’s name links to the home page by default, not to the author’s page (author/shahriar-robin/). https://prnt.sc/DZIQ7NF7-oJE
    https://prnt.sc/NVIqnh6Nqcu8

    I don’t want to edit the author’s url every comment.
    I want to add the author’s page (author/shahriar-robin/) in the comment section by default, not to the home page.

Viewing 3 replies - 1 through 3 (of 3 total)
  • function use_author_link_as_comment_author_url( $url, $id, $comment ) {
        if ( $comment->user_id ) {
            return get_author_posts_url( $comment->user_id );
        }
        return $url;
    }
    add_filter( 'get_comment_author_url', 'use_author_link_as_comment_author_url', 10, 3 );

    Can you please try above given code on functions.php file? I hope this will solve your issue.

    Thread Starter Robin

    (@nioriaa)

    @devmuhib Thanks for sharing it.

    It is working.

    • This reply was modified 11 months, 2 weeks ago by Robin.

    I am glad, it helped you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘When the author replies to comments, the author’s name links to the home page’ is closed to new replies.