我想在author arhive页面中包含自定义帖子类型。我尝试了本文中讨论的方法:
Including post_type = 'wiki' in author archives
add_action( \'pre_get_posts\', \'custom_post_author_archive\' );
function custom_post_author_archive( &$query )
{
if ( $query->is_author )
{
$query->set( \'post_type\', \'custom_name\' );
remove_action( \'pre_get_posts\', \'custom_post_author_archive\' ); // run once!
}
}
但通过此方法,只查询custom\\u name post。我想查询custom\\u name帖子和普通帖子。我需要做哪些更改?