更改WordPress网站的作者链接地址

在WordPress搭建的网站中,作者简介的默认链接地址为 yoursite.com/author/name 。假如你不打算使用结构中的作者“author”字样,比如使用个人资料“profile”,让作者简介的链接地址改为 yoursite.com/profile/name 。

将下面代码粘贴在您的 functions.php 文件里即可:

// Change Author Links
add_action('init', 'cng_author_base');
function cng_author_base() {
    global $wp_rewrite;
    $author_slug = 'profile'; // change slug name
    $wp_rewrite->author_base = $author_slug;
}

 

给力代码来自:http://www.wondercss.com/2013/wordpress/1866/.
感谢原作者分享

小 虾

哦也,我是小虾

You may also like...