我正在使用 Yoast Seo 插件在我的标题下显示面包屑。
我通过将下面的代码放在
functions.php.
中,将默认的
author
url 更改为 about/team
add_action('init','change_author_permalinks');
function change_author_permalinks()
{
global $wp_rewrite;
$wp_rewrite->author_base = '/about/team';
$wp_rewrite->author_structure = '/' . $wp_rewrite->author_base. '/%author%';
}
所以
mysite.com/author/author name
将是mysite.com/about/team/author name
.
我希望有人访问时面包屑是这样的
mysite.com/about/team/authorname
:
作者姓名 « خانه » دربارهu200c ما » اعضا
但是它显示了存档的路径:
author name خانه » بایگانی
有没有办法手动覆盖它?
翻译:
对于更高级的面包屑项操作,除了 Yoast 的基本选项,您还可以使用“wpseo_breadcrumb_links”过滤器。 以下是一些可以帮助您入门的示例:https://gist.github.com/amboutwe/ea0791e184668a5c7bd7bbe357c598e9