Skip to:
Content
Pages
Categories
Search
Top
Bottom

Show Displayname and Username together in comments

  • @notpoppy

    Participant

    When a user comments on my (Buddypress-enabled) blog, the comment appears under their Displayname.

    However if a user wishes to reply to them using an @-message, they need to know their Username, and this isn’t always immediately obvious. Consequently, I get a lot of users typing in the Username incorrectly, or just typing the Displayname prefixed by an @ symbol.

    What I’d like to do is show both the Displayname and Username next to each comment, e.g.:

    Ben (@bensmith101)

    I’ve had a look in the code for comments.php and coding this seems some way beyond my abilities! Can anyone suggest how to do this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • @wceolin

    Member

    If you use default BP theme just replace that line after class=”comment-meta” to:

    http://pastebin.com/LMbh4mwQ

    However, I don’t know how to do same with group forums. Any ideas?

    @notpoppy

    Participant

    Thanks for the suggestion @wceolin

    I found the following in functions.php which seems to be the code I need to replace:

    `

    <?php
    /* translators: 1: comment author url, 2: comment author name, 3: comment permalink, 4: comment date/timestamp*/
    printf( __( ‘%2$s said on %4$s‘, ‘buddypress’ ), get_comment_author_url(), get_comment_author(), get_comment_link(), get_comment_date() );
    ?>

    `

    I don’t know how to replace the code in functions.php – I’m happy to look up how to do that, but before I do I just wanted to check this is definitely the code I need to replace and I’m not barking up the wrong tree!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Show Displayname and Username together in comments’ is closed to new replies.
Skip to toolbar