WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Administrators/Editors appear as 'Anonymous' in comments (3 posts)

  1. steveedin
    Member
    Posted 1 year ago #

    A strange thing started happening today. All comments by Administrators and Editors (there are three) lost their display name and it was replaced with the name Anonymous.

    The correct name is on each user's profile and in the database.

    I'm totally baffled. Any ideas?

    Thanks

  2. steveedin
    Member
    Posted 1 year ago #

    Solved. This code was in the functions.php. I'll find another way to remove the URL link on the comment author's name...

    /** Removes link to comment author website */
    function author_link(){
    global $comment;
    $comment_ID = $comment->user_id;
    $author = get_comment_author( $comment_ID );
    $url = get_comment_author_url( $comment_ID );
    if ( empty( $url ) || 'http://' == $url )
    $return = $author;
    else
    $return = "$author";
    return $return;
    }
    add_filter('get_comment_author_link', 'author_link');
  3. steveedin
    Member
    Posted 1 year ago #

    In the theme_post_comments.php i just replaced...

    <?php comment_author_link(); ?>
    
    with
    
    <?php comment_author(); ?>

    All working now :)

Topic Closed

This topic has been closed to new replies.

About this Topic