是否可以将默认的_AUTHER_POSTS_LINK设置/覆盖为登录名?

时间:2011-01-16 作者:flippWP

\\u author\\u posts\\u链接非常方便。但是WordPress现在有没有办法为所有新作者设置/编辑默认显示名称?(我知道你可以按作者手动编辑)。我希望它是user\\u登录,然后我可以相应地调用\\u author\\u posts\\u链接。

1 个回复
SO网友:Rarst

尝试此操作,它会将显示名称更改为循环中任何位置的登录名:

add_filter(\'the_author\', \'return_login\');

function return_login($display_name) {

    if ( !in_the_loop() )
        return $display_name;

    return get_the_author_meta(\'login\');
}

结束

相关推荐

如何从wp_list_Authors中排除特定作者

我想让作者像往常一样从wp_list_authors() 但我知道有几个我也想从名单中排除。有办法吗?谢谢