我正在寻找解决方案,在那里我可以得到年,月和日期存档列表中的所有自定义帖子类型。因此,它可以按任何年份、月份或日期进行筛选。我正在寻找下面这样的函数,我正在使用它为作者包含CPT
function custom_post_author_archive($query) {
if ($query->is_author)
$query->set( \'post_type\', array(\'wp_plugin_review\', \'png_gallery\', \'post\', \'news\') );
remove_action( \'pre_get_posts\', \'custom_post_author_archive\' );
}
add_action(\'pre_get_posts\', \'custom_post_author_archive\');