Display Usernames by default in Comments
-
I can’t seem to find a viable solution to this.
This is what I’m trying to accomplish:
By default for all comments any user that posts a comment, I would like there username to be displayed and not the full name. I don’t want to change this manually, I need to have it implmented in the code somewhere so by default it displays there username. I know I’m going to have to add $current_user->user_login somewhere but I’m not sure where. It may just be easier to create a plugin that does this automatically, which I have been testing but can’t get to work. (see below)
<?php $showName = $current_user->user_login; echo "s: " . $showname . " d: " . $current_user->user_login; if ($current_user->user_login != $showName) { update_user_meta($current_user->ID, 'display_name', $showName); }?>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Display Usernames by default in Comments’ is closed to new replies.