Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter jheind

    (@jheind)

    I figured it out, I think. I found a snippet of code that removed the comment author and then modified it to just manipulate the author’s name. I placed it in my child theme’s functions.php and it did what I wanted it to.

    if ( ! function_exists( 'abbreviate_comment_author' ) ) :
    
        function abbreviate_comment_author( $author ){
            list($author_first, $author_second) = explode(' ',$author, 2);
            $author_second = $author_second[0] . '.';
            $author = $author_first . ' ' . $author_second;
            return $author;
    }
    add_filter( 'get_comment_author', 'abbreviate_comment_author' );
    add_filter( 'comment_author_rss', 'abbreviate_comment_author' );
    
    endif;
Viewing 1 replies (of 1 total)