Thread Starter
sr3
(@sr3)
I don’t want to change the display name manually for every user. I’m looking for some code to set the default display name automatically to the wordpress username.
Thread Starter
sr3
(@sr3)
With this code I could remove the author link
add_filter( 'get_comment_author_link', 'rv_remove_comment_author_link', 10, 3 );
function rv_remove_comment_author_link( $return, $author, $comment_ID ) {
return $author;
But I still don’t know how to show the username instead of the full name?
Thread Starter
sr3
(@sr3)
I couldn’t add it to the submenu, so I added it as the last item of my main-menu. But now it’s working.
I added the following code at the end of the functions.php of my child-theme:
add_filter('wp_nav_menu_items', 'add_login_logout_link', 10, 2);
function add_login_logout_link($items, $args) {
ob_start();
wp_loginout('index.php');
$loginoutlink = ob_get_contents();
ob_end_clean();
$items .= '<li>'. $loginoutlink .'</li>';
return $items;
}