您注意到您正在使用自定义帖子类型。
To see if that is the problem:
<为每个用户创建一个普通的“帖子”(不是自定义帖子类型)
查看他们的页面是否突然出现如果是这样,那么您的作者页面很可能没有设置为显示自定义帖子。
要解决这个问题,您可以在功能中使用以下内容。php文件(或更改作者页面上的查询):
function my_show_special_posts_on_author( WP_Query $query ) {
# Make sure you are only altering the query on the author page
if ( $query->is_author() && $query->is_main_query() && !is_admin() ) {
# Grab the current post types to be shown
$types_to_show = $query->get(\'post_type\');
$types_to_add = array( \'custom_post_type_1\', \'custom_post_type_2\' );
if ( is_array($types_to_show) ) {
# Already showing an array of types, add yours if not already included
foreach ( $types_to_add as $post_type ) {
if ( !in_array($post_type, $types_to_show) ) {
$types_to_show[] = $post_type;
}
}
} else if ( empty($types_to_show) ) {
# Strange. Not showing any types. Add yours anywise.
$types_to_show = $types_to_add;
} else {
# A single one as a string, add it to your types to add then overwrite types to show
$types_to_add[] = $types_to_show;
$types_to_show = $types_to_add;
}
$query->set(\'post_type\', $types_to_show);
}
}
add_action(\'pre_get_posts\', \'my_show_special_posts_on_author\');
务必调整管路
$types_to_add = array( ... );
这将强制您的自定义帖子类型显示。