Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

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

Display full name in comments instead of user name


  #1  
Old May 21, 2009, 02:32 AM
tationline
 
4 posts · Apr 2009
Cologne, Germany
Hello,

I am using Atahualpa 3.3.2. Is it possible to change the way the author name in comments in displayed?
Currently it shows e.g. "user1" (login name)
I would like to see the full name of the user who wrote the comment, e.g. "User One" (firstname lastname).

I saw that there are several author name options in the "Post/Page Info Items", but I couldn't find the right spot where to change it for comments.

Thanks in advance for help
  #2  
Old May 21, 2009, 06:10 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
Post/info items is not for comments, only for posts and pages.

You mean the displayed name for logged in users? (Since all others choose their author name anyway, by putting it into the "name" field in the comment form).

Replace in functions/bfa_custom_comments.php

PHP Code:
<?php comment_author_link(); ?>
with
PHP Code:
<?php if ($comment->user_id) {
$user=get_userdata($comment->user_id);
echo 
$user->user_nicename;
} else { 
comment_author_link(); } ?>
  #3  
Old May 22, 2009, 03:08 AM
tationline
 
4 posts · Apr 2009
Cologne, Germany
Thanks for your quick response.
Yes I mean the display name in comments for registered users.

I just tried to make the changes, but I do not have the file functions/bfa_custom_comments.php
This is also not available in the original zip-file (atahualpa332.zip).

Should I create this file?
  #4  
Old May 22, 2009, 07:40 AM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
Sorry, bfa_custom_comments.php was introduced in 3.3.3

In 3.3.2 replace in functions/bfa_comment_walker.php

PHP Code:
<?php printf(__('%s'), get_comment_author_link()) ?>
with

PHP Code:
<?php if ($comment->user_id) {
$user=get_userdata($comment->user_id);
echo 
$user->user_nicename;
} else { 
comment_author_link(); } ?>
  #5  
Old May 26, 2009, 05:40 AM
tationline
 
4 posts · Apr 2009
Cologne, Germany
Hi Flynn,

I modified the file as you suggested, but within the comments section there is still the username visible and not the full name. I tested it with existing comments and new comments (created after the change).

Is there anything else that needs to be done?
  #6  
Old May 27, 2009, 05:58 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
change 'user_nicename' to 'display_name' and then make sure to pick the format you want in the dashboard -> Users -> Your Profile -> Display name publicly as:

Flynn,
looks like nicename isn't the right row to use. It would be nice to grab and concatenate 'first_name' and 'last_name' from wp-usermeta.

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do people sign up as a user for a comment? nasu Page & Category Menu Bars 6 Jul 12, 2013 12:40 PM
Improvements suggested by new user MrBean New Versions, & Updating 2 Jun 21, 2009 12:25 AM
User Community designer666 Plugins & Atahualpa 2 May 15, 2009 05:52 AM
User Registration link vincotek Atahualpa 3 Wordpress theme 8 May 6, 2009 03:50 PM
User Photo johnnewton Atahualpa 3 Wordpress theme 3 Mar 15, 2009 02:43 PM


All times are GMT -6. The time now is 10:09 PM.


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