您可以使用如下新的重写规则添加此页面:
add_action("init", function () {
add_rewrite_tag("%specialAuthor%", "([^&]+)");
foreach (["personalinformation", "settings"] as $specialAuthor) {
add_rewrite_rule(
"author/([^/]+)/($specialAuthor)/?$"
, "index.php?author_name=\\$matches[1]&specialAuthor=\\$matches[2]"
, "top"
);
}
});
add_filter("author_template_hierarchy", function ($templates) {
$specialAuthor = get_query_var("specialAuthor", NULL);
if (isset($specialAuthor)) {
$author = get_queried_object();
$templates = [
"$specialAuthor-{$author->user_nicename}.php",
"$specialAuthor-{$author->ID}.php",
"$specialAuthor.php",
];
}
return $templates;
});
第一次刷新重写规则:
https://codex.wordpress.org/Function_Reference/flush_rewrite_rules然后,复制author.php
到personalinformation.php
在URL的主题中site.com/author/.../personalinformation