Hi i am working on custom post types in wordpress presently we are using below code to display the custom posts, but the thing is the custom post types are keep on increasing,
add_action( 'pre_get_posts', 'add_my_post_types_to_query' );
function add_my_post_types_to_query( $query ) {
if ( is_home() && $query->is_main_query() )
$query->set( 'post_type', array( 'books', 'recipes', 'movie' ) );
return $query;
}
from above query i am calling the posts from books,recipes and movie but due increase of post_types i cant add all the post types in the above query.
dose anybody have idea how to call all the posts from all post_types.