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/”
- How to get taxonomy category in permalink for each taxonomy OR How to give a parent page to a given taxonomy?
- Style custom columns in admin panels (especially to adjust column cell widths)
- Why are comments and trackbacks still getting through for custom post types?
- Display a query with multiple post types and same relationship on a single page
- Why get_next_post_link() or get_previous_post_link() doesn’t return the required links?
- Add metabox with media uploader in a custom post type [duplicate]
- Add Settings to Custom Post Type
- How to set a custom post type post as static front page?
- Add links to post categories and taxonomies in wysiwyg link modal?
- Displaying Post Title on Post Edit page?
- How to save contact form 7 data in Custom Post Types (CPT) [closed]
- Custom user role not working as expected
- Rewrite on custom post type permalink not working?
- Wp-query causing problems with the_content();
- Custom Taxonomy Breadcrumb Navigation
- Make custom post type display as a page
- Problems excluding a custom post-type from the loop
- Is it possible to make tag archive page specific to Custom Post Type?
- get custom post type categories
- Custom query variable – get wordpress to redirect to nice permalink url
- Multiple portfolios with one custom post type?
- Custom Post Type and Taxonomy combination
- XML-RPC and Custom Post Types
- How to enable a custom post type to custom user role in WordPress
- How to create an array for a CPT post ID to use in an IF/WHILE statement
- How to filter search results by post type?
- Can’t unregister parent theme’s CPT from my child theme
- Unable to show meta box data in frontend
- Get Post Primary Category
- Loop through Custom Post Type, and then show children within each iteration
- how to get URL of media uploaded to WordPress via media_handle_sideload()
- How to only show posts assigned to current user, only in certain post types
- Archive for custom taxonomy lists all posts instead of current taxonomy
- Parent and Child relation for custom post types
- modrewrite not working on my Apache setup
- search also in taxonomy, tags and custom fields
- forming WP_Query for posts of all post types but from specific categories
- How can I get the number of custom post type posts that have a specific attachment image set?
- Bulk Update Custom Fields for Custom Post Types
- Best way to style first post differently?
- Displaying All Posts of a Custom Post Type in WordPress Multisite Backend
- New checkbox in custom post type widget isn’t saving data
- Removing all post statuses from a Custom Post Type
- Send notification to the admin when new custom post is submitted
- Adding Page Templates to post but it ignored it
- Parent Page and Breadcrumb URL’s for Custom Post Types Not Working
- Post to Top in Array
- Detect inside a custom query the kind of post type to assign custom classes
- Check if post with same meta value exists
- Checking if looped item has a parent inside a shortcode
- Do posts, pages and / or custom post type objects have unique ID numbers or can there be multiple objects with the same IDs?
- Recoverable Fatal Error – Object of class WP_Post could not be converted to string
- Running a song lyrics site on WordPress
- Getting all ID’s matching a title in a custom post type
- Assigning alternate single-{cpt} template based on blog_id in multisite
- How can i add multiple variable to a !== query
- Topic won’t save for a custom post type — how to debug?
- How to Create a Separate Page for Blog Posts in WordPress
- Migrating Hierarchal Taxonomy Categories Between Post Types
- Advanced custom fields Post Object image field not displaying in custom post type single.php
- How do I display child post types in the parent post type template
- How can I make custom static widgets/areas on my homepage?
- Custom Taxonomy dont save in a frontend form for post a custom post
- Plugin needed to allow subscribers to post articles on the front end without admin approval [closed]
- Page template that uses lightbox to display post images
- Change Dropdown jQuery to show/hide but with default place holder that shows all
- Get the taxonomy value in the post loop inside the archive page
- Custom post type archive URLs with a single taxonomy
- How to get rewrited name of cusom taxonomy?
- How to access repeater field of a custom field?
- Custom Post Type 404 Error even after flushing rewrite rules
- Custom post types & Pages hierarchy – Error 404
- custom post type section selector
- Update/publish custom post type with jQuery?
- Previous/Next custom post links within custom taxonomy
- Custom post type: “transition_post_status” action get title and other fields
- wp_dropdown_pages doesn’t allow me to select more than one custom post type
- Override “Parent” input for custom taxonomy
- How to develop custom URL redirection
- Custom post type with Filter and Page Nav
- Custom Post Type Archive Links Not Working
- Custom Post Type Categories Not Maintaining URL structure any more
- Why is this custom post type defaulting to archive.php?
- Custom post types permalinks not working
- How do I ensure custom post type information is displayed in correct order?
- Tag-post relationship problem
- Rewrite rules for using the same base slug for multiple content types
- Custom Post type as Taxonomy
- Getting 404.php instead of single-.php [duplicate]
- How to manage wordpress knowledge base/wiki/posts collections
- add_rewrite_rule not working in Custom Post Type UI Plugin
- WP Query + custom fields: How to query event posts from the current date backwards 6 months and organize it month by month?
- Custom post type Premalinks main page and details page
- Remote database access on another wordpress site’s custom post type
- How do I get parameters from the URL?
- Add custom text in /post.php?post=503&action=edit