I am looking for solution where I able to get all custom post types in year, month and date archive list. So it can be filters by anything either year, month or date. I am looking for function something like below which I am using to include CPT for authors
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');
Your code simply adds post types to the query when on the author archive so to do the same with date archive simply replace
is_author
tois_date
: