You may edit the query using the pre_get_posts action. You can do something like this:
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
}
}
Related Posts:
- How to create Blog Post Specific Widget
- Exclude Custom post type from /blog page
- Show only Current category and sub category of custom post wordpress
- Permalink for regular posts “/blog/”
- Loading External Scripts in Admin but ONLY for a Specific Post Type?
- Set posts of a custom post type to be private by default?
- register_post_type sort order by title by default
- Custom post types – Use post_id in permalink structure
- Rewrite custom post type rss feed links
- Populate Taxonomy from Custom Posts
- Order users by number of posts
- Show related posts on single page by custom taxonomy on custom post
- Priority of Meta Box for Custom Post Type
- Using previous_post_link and next_post_link to wrap around post sequence
- Same base slug for CPT post and CPT taxonomy terms
- how to make custom posts sticky? [duplicate]
- Custom Post Type, Two categories, Two columns with Pagination
- Replacing the title in admin list table
- Get URL for specific post type and current tag
- How to set custom post type as post title to avoid ‘Auto Draft’
- Parent page for CPT
- Unable to get wp_redirect() working after adding a CPT via the front end
- How to validate custom fields for a custom post type before insert?
- Custom Post Type slug same as page name causing a conflict
- Formatting custom meta box date from YYYY/MM/DD to a more readable alternative
- Custom Post Type “Event” with custom permalink structure
- Prevent authors from creating new posts of specific custom-post-type
- Why is my custom loop not filtering correctly nor paginating?
- Display types of posts in edit.php instead of All, Published, Scheduled and Draft
- Custom post types with custom directories
- How to associate two different post types (think Book and Chapter)
- How can I get the first 50% of all posts (within a custom post type)?
- Separate comment section for post type in dashboard
- GravityForm: Populate Dropdown with custom post type [closed]
- get_terms showing all categories instead of the ones assigned to a specific post
- Does WordPress limit the length of slug names for Post Meta or Terms?
- Subpages for Custom Post Type. Does that even exist?
- Role capability delete multiple post type posts doesn’t work
- Loop to fetch 3 post_thumbnail instances from 3 most recent custom post types named “portfolio”
- filter custom post type by meta key in dashboard
- How to use load more custom post type data normal or according to on click category tab In WP
- ACF Field on CPT Slug
- Is it possible to create custom post type inside another CPT?
- I need to add endpoint for wordpress categories
- Allow duplicate slugs for custom post type with taxonomies
- Broken featured images are uploading from frontend
- Meta Query Not Returning Output Despite Having Matching Values
- Using taxonomy term in CPT permalink – Pages 404’s
- Custom Post Type Archive URL is wrong
- How to use custom template files in deeper directory?
- Display Custom Taxonomy Alphabetically
- Custom post type archive pagination 404
- Use “archive” as slug for custom post type
- Taxonomy in URL
- Warning: Invalid argument supplied for foreach() [closed]
- Custom post type isn’t working
- Creating my own portfolio custom-type
- Multiple pages per post (not pagination)
- Author posts not appearing for custom post type
- How to concatenate two separate colums into one?
- Why content coming from single?
- Strip Characters From Tag Name
- What would be a proper name for a custom post type created for static content?
- Unable to edit categories in custom post type
- Get taxonomy term by slug in post on archive page
- Displaying custom fields for custom post type generate with Custom Post Type UI Plugin
- Query not work for current taxonomy
- Creating shortcode id for custom post types
- get_post_meta returns NULL in front-end, but correct result in back-end
- does wp_insert_term link the term to a certain post ID?
- Ideas to connect external database table to wordpress posts as custom field source
- CPT structure questions
- Custom post type category permalinks and archive pages
- All in one calendar custom post type query doesnt work as expected
- Navigate by Tags inside a custom Post Type
- add_filter get array data before display in custom post_type
- WordPress Custom Post Loop
- programmatically generated custom post type is created more than once
- How to show posts of the same category on a page?
- Button link display in shortcodes using custom field in ACF
- Peepso: Add extra data field (custom post meta) to postbox
- Create posts inside CPT post
- wp delete duplicate entries of custom post types every 15 minutes
- Can I manage current & past editions of an annual event with a single WordPress install?
- How to hide sub fields in a field group and also the entire field group if the answer selected is “no”
- Taxonomy to Post Type. Every Taxonomy Item can be Producer or Developer
- WordPress Front-End user restricted taxonomies
- do action inside a class is not working
- Edit post meta direct from post.php?
- Custom Post ‘Post Per Page’ Crashing Page?
- Create an additional template page for every term taxonomy
- Custom Post Type Not Displaying Correctly
- How to solve performance issue caused by custom post type overview with 20k+ custom taxonomy terms
- Query Distinct Taxonomies of Custom Post Type
- Excerpt for each post type and for is_front_page
- Show taxonomies from specific CPT
- Change the text on the Publish button
- Loop through multiple custom taxonomy terms and display posts for a custom post type
- strange conditional tag behaviour [duplicate]
- Comments are not working on Custom Post Type