Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

the_author_posts_link is so handy. But is there now way in WordPress to set/edit the default display name for all new authors? (I know you can manually edit per author). I'd like it to be user_login, and then I can just call the_author_posts_link accordingly.

share|improve this question

1 Answer 1

Try this, it will change display names to logins anywhere in the Loop:

add_filter('the_author', 'return_login');

function return_login($display_name) {

    if ( !in_the_loop() )
        return $display_name;

    return get_the_author_meta('login');
}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.