use post__in key instead of include to get posts from the specific post ids.
$args = array(
'post_type' => 'testimonials',
'posts_per_page' => 4,
'orderby' => 'ID',
'post__in' => array(883, 563, 568, 106),
);
And to order posts by the given posts ids, you can use the following array.
$args = array(
'post_type' => 'testimonials',
'posts_per_page' => 4,
'orderby' => 'post__in',
'post__in' => array(883, 563, 568, 106),
);
Related Posts:
- Limit the post for differents custom post type in the same wp_query
- ascending order custom post type
- Display custom post types with custom date field value (before today) & order by custom date field
- Limit the post for differents custom post type in the same wp_query
- Querying multiple values from a single key
- Ordering custom post type by custom field without a title
- Listing all term items alphabetically / sorting loop
- Manage Columns : order by post_parent’s title
- Order by custom field meta_key date and then by custom file meta_key number
- pagination not working for category.php (custom post types in categories)
- How to display Related Posts based on number of taxonomy terms matched
- Filter date from post meta when date is in string format
- query_posts adding extra code to homepage
- Archive not sorting correctly
- How to show only the most recent post on my custom post type archive?
- 4 column-loop ordered alphabetically with entries grouped (and labeled) by their first letter
- Ascending Order is not Working in Custom Post Type Listining
- Custom Post Types — $args vs. labels array
- How to make WP_Query not to show irrelevant posts?
- Add a custom meta box for client to order CPT posts how they want
- What is the ID parameter for custom post types in query_posts?
- Loop for custom post types filtered by a taxonomy
- Get an array wich contains the post_name of every post that has the custom post_type “pelicula”
- Add first letter of titles to array, then compare arrays
- Custom post type sorting: alphabetical order
- How to limit post per page of custom post type?
- Query Custom Post Types with checkboxes
- Custom query – get_the_terms not work
- Create Array from custom post type to display a slider
- 3 random images from custom post type, each in a div with a diffrent class
- Why are some of my custom posts not showing up on my page?
- $wpdb->get_col and ORDER BY?
- post-per-page and offset not working
- Control content before and after custom post type loop
- Custom post type, custom taxonomy, query posts only from taxonomy (children of)
- Display custom posts randomly in custom taxonomy archive
- Getting all ID’s matching a title in a custom post type
- why is the current page title being output?
- Count custom post type based on two meta data
- Inefficient Query Confusion
- Not able to export large no. of posts in csv
- attach CPT data to a taxonomy
- Check if user has comment on current post
- Having Issue on Ordering CPT by Custom Field In Custom WP Query
- Pagination not working on custom query on a page
- Loop through posts of only 2 statuses
- Targeting custom post type via functions.php doesn’t work
- find custom post type post by searching its custom field with my string
- FacetWP paging custom wp_query
- WP_Query of custom post type sorted by meta_key has unexpected results
- WP_Query not resetting after wp_reset_postdata
- get_terms() returns Trying to get property of non-object error for custom taxonomy
- WordPress query reverse order
- Can’t change posts per page in WordPress Post Type Query
- postsperpage value not being applied
- How do I disply an array inside a custom post type?
- Custom Post Type Field Array parsing [closed]
- Best way to create a search for custom post type by custom field values
- Dynamic category name in query post
- Getting custom post types to properly display alphabetically
- Post ordering not working with custom field
- Incorrect ordering of custom post type based on time
- List all posts in taxonomy term
- Query all post types but limit to parents
- Filtered by a custom field, ordered by another
- orderby parameter not working in custom query
- Adding Page Ordering to a Custom Page Type
- HM CMB: Post Select Field for CPT ID
- 4 posts per page from single category
- Display Posts Query with IF function
- Query Multiple Custom Post Types & Exclude a Taxonomy Term
- Custom Post type showing up in loop, regular posts are not showing up
- Displaying Portfolio Filter by Category Order (alphabetically)
- Query Custom Post Type based on text input
- show most viewed posts of last days by link?
- Getting custom post type info using get_adjacent_post
- Custom Post Type Query W/Category Dropdown
- Changing WordPress sort order for returned child pages
- Query all posts under one taxonomy? Why is my code not working?
- Custom Post Types Not Showing Up In query_posts Result
- Find Posts based on Child Post value
- Query for bbPress replies to current topic?
- Custom Post Type ‘Event’: Chronological list of recurring events from meta_values in array
- Showing only posts from the current user who is logged in?
- Why can’t I query more than 1 post type at a time?
- Sorting the Loop by Taxonomy Value
- Custom Query: Multiple CPTs and a taxonomy filter
- How can I loop at a Specific Taxonomy from a custom post type?
- Update value inside array update_post_meta
- WP query_posts group by meta field related
- returning the currect URL for nested posts
- Custom archive page for custom taxonomy and pagination issue
- Sticky posts limit query and pagination for a custom post type
- Custom wp-query display post only today
- Order posts by taxonomy terms
- wp rest api orderby field in a custom table
- Custom post type archive page filters
- Get an array of the number of post per year of a custom post type (WordPress)
- Display Parent-Child Posts in specific order by comparing IDs in array
- Filling custom post type posts from a rest api