I'm trying to get all custom post types to appear in my archive sections on a site, including monthly, tagged, author archives. At the moment, I've thought of something like:
add_filter('pre_get_posts', 'sw_custom_post_type_includes');
function sw_custom_post_type_includes($query) {
$post_type = array('post','custom1','custom2','custom3');
$query->set('post_type',$post_type);
return $query;
}
But I don't want to use pre_get_posts, as this messes with all queries. Is there a filter for, in effect, pre_get_archives? Can't seem to find a solution on Google.