默认情况下,WordPress会将文章作者链接到作者文章存档页面,这个对于多作者站点来说,是非常不错的功能,但是如果整个博客就只有一个作者,这就显得多此一举了。为此,倡萌建议将作者链接到“关于(about)”页面,将下面的代码添加到主题的 functions.php :
add_filter( 'author_link', 'my_author_link' );
function my_author_link() {
return home_url( 'about' );
} |
add_filter( 'author_link', 'my_author_link' );
function my_author_link() {
return home_url( 'about' );
}
然后新建一个页面,别名为 about,就可以了。或者你也可以修改第四行中的地址,就可以重定向到任何地址,比如你开发了一个前端用户中心,重定向到用户中心是非常不错的哦!
来源:
https://www.wpdaxue.com/redirect-author-archive-link-to-about-page.html
微信公众号
手机浏览(小程序)
Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(): Failed to enable crypto in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_32781.jpg): failed to open stream: operation failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57