您可以使用pre_get_posts 行动您可以这样做:
add_action(\'pre_get_posts\',\'wpse_218948_search_filter\');
function wpse_218948_search_filter(){
if( is_page(\'blog\') /* or whatever page it is */ && $query->is_main_query() ){
$query->set(\'post_type\', \'blog\'); # query post type "blog"
$query->set( \'posts_per_page\', -1 ); # display all posts
}
}