Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jeff Farthing

    (@jfarthing84)

    You would need to use the tml_title filter to change the title according to the action:

    
    function my_custom_tml_title( $title, $action ) {
        if ( 'login' == $action && is_user_logged_in() ) {
            $user = wp_get_current_user();
            $title = sprintf( 'Welcome, %s', $user->display_name );
        }
        return $title;
    }
    add_filter( 'tml_title', 'my_custom_tml_title', 10, 2 );
    
    Thread Starter andhiirawan

    (@andhiirawan)

    Hello jeff where should i put the script?
    I’ve put it in theme-my-login-custom.php file.
    But did not show as well in Header.

    Plugin Author Jeff Farthing

    (@jfarthing84)

    I recommend placing all TML-related code in wp-content/plugins/theme-my-login-custom.php.

    Thread Starter andhiirawan

    (@andhiirawan)

    Hi Jeff,
    I’ve made it on theme-my-login-custom.php :

    https://text-share.com/view/11a6285b

    but after login the user name still does not appear
    Just Logout and Your Profile only in the header.
    Are there any settings I missed?

    Plugin Author Jeff Farthing

    (@jfarthing84)

    You have all of the code from theme-my-login.php there – that doesn’t belong. Also, how are those items added to the header? Is it a wp_nav_menu()?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘User Name in Header’ is closed to new replies.