Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages » Comments, trackbacks & pings »

Modying comment author display

Old Apr 13, 2010, 09:44 AM
11 posts · Nov 2009
Out of the box when a *logged-in* user types a comment on a Atahualpa blog it displays their nickname (which might be the same thing as their first name? not sure) next to their comment.

So for me, for example, my nickname is "Mark" and my username is "piphut". When I post a comment it takes the form of:

Mark: this is my comment.

What I would like to do is add the username next to the nickname, in parenthesis, next to an '@' symbol. The username would not link to anything, just be text. So the above comment would now look like:

Mark (@piphut): this is my comment.

Any suggestions?

P.S. for anyone interested this is because I recently integrated Buddypress with atahualpa and using the @username function works just like a twitter mention. @nickname does nothing.
Old Apr 20, 2010, 02:20 PM
11 posts · Nov 2009
bump. Any ideas for this?
Old Apr 20, 2010, 05:53 PM
juggledad's Avatar
23,743 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
This is not something that is done in the theme, it's done in the wordpress code. the actual call to teh wordpress code is in bfa_custom_comment.php line 16 (in version 3.4.6) There you will see a comment_author_link() and that is the routing that gets the comments (it is in wp-includes/comment-template.php)

What is worse is that the value that is dislayed depends on the setting of the 'Display name publicly as' option of teh USER profile AT THE TIME THE COMMENT IS MADE. i.e. if the user name was 'admin' and the 'Display name publicly as' is 'admin' when you make a comment, the comment shows as being made by 'admin'. If you now go in to the admin user and add a nickname of 'The Man' and change teh 'Display name publicly as' to 'The Man' and make a comment, it will display as 'The Man' while the previous comment will show 'admin'

so....no there is no easy way to do what you want to do, the name associated with the comment is actually stored in the comment at the time it is made. - you can actually delete a user from te database and their name will still be associated with comments they have made.
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
Old Apr 24, 2010, 03:02 PM
1 posts · Apr 2010

This is possible by hacking two lines in wp-comment-post.php.

check from line 50...

if ( $user->ID ) {

//if ( empty( $user->display_name ) ) // comment this line out
// $user->display_name=$user->user_login; // comment this line out
$user->display_name = $user->display_name."(@".$user->user_login.")"; // add this to the line that sets the comment name
$comment_author = $wpdb->escape($user->display_name);
$comment_author_email = $wpdb->escape($user->user_email);
$comment_author_url = $wpdb->escape($user->user_url);


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How can I enable author to edit its comment? 112358oo Comments, trackbacks & pings 2 Nov 10, 2009 08:22 AM
Author Pages (again) - display bio, links, etc? theangryblackwoman Atahualpa 3 Wordpress theme 1 Jun 10, 2009 08:37 AM
comment author link... designer666 Comments, trackbacks & pings 1 May 11, 2009 01:23 PM
Author comment background to appear the same in all levels of commenting perdox808 Comments, trackbacks & pings 0 Apr 21, 2009 06:19 AM
How to display the name of the author? wy007 Post-Kicker, -Byline & -Footer 2 Feb 5, 2009 12:36 AM

All times are GMT -6. The time now is 09:03 AM.

Powered by vBulletin® Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.