The syntax is not ‘post-type’ or ‘post-status’, it is with an underscore instead of a dash:
'post_type' => 'testimonials',
'post_status' => 'publish',
Related Posts:
- Where to put my code: plugin or functions.php?
- WP Query group/order by category name
- Custom Taxonomy and tax_query Issue?
- Orderby CPT custom fields not working
- Custom Widget WP_Query problem
- how to set a WP Plugin’s url
- filter the_content, custom post type, and wp_query
- Is there a (preferable built-in) way to check what custom queries are used in a theme?
- Wp Meta Query does not work while simple Query Works
- Get next and prev item from custom WP_Query and Custom Post Type
- Replace Content of Sidebar on Custom Post Type
- Widget area for individual posts (custom post type)?
- Error in WP Query. If variable is empty it is displaying previous post value
- Custom Taxonomy Not Showing in Menu
- Custom Post Type | Fatal Error on register_post_type()
- Loop on front-page.php
- Set object terms not working on plugin activation
- Custom query shows custom post types in trash
- Multiple post type queries (with specific arguments for each)
- Using custom page templates with plugin [duplicate]
- Is it possible to create a shortcode that will query a post based on taxonomies?
- Filtering by Post Meta Custom Fields – Performance
- need advice on how to do a lists using custom post types – taxonomy vs postmeta
- tax_query returning all posts instead of selective posts in WP_Query
- wp_query to find posts by year and month
- WP_Query is printing out only one post when posts_per_page is set to multiple
- WP Query to displaying date and posts for that date?
- Custom WP_Query not returning results when querying custom post type
- WP Query—Relationship between two custom post types and their fields
- Get all of user’s custom post types in WP Admin for plugin
- How to dynamically attach pictures to a carousel
- Is it possible to apply a meta_query to one specific post type in a query with multilple post types?
- Remove duplicated values from a loop
- Unable to get paginate_links working with a custom query [duplicate]
- Get custom posts with certain ids in a custom loop using a shortcode
- Querying Term Posts in Loop
- Issue with pre_get_posts on custom post type archive pages
- Custom Post Type Navigation on Custom Field
- How to use WP_Query in a CPT achive page?
- Use get_post_types to query only custom posts types
- WordPress Orderby Numeric Value Not Working
- Custom Post Type Loop within Shortcode
- Fetch taxonomies by custom post type id array
- Plugin translation not working apart from name and description
- Get rewrite slug of custom post type in template
- Use WP_Query() to Output the 4th to 6th Most Recent Posts of a Custom Post Type
- Get all Posts If has same custom field values in Posts
- is_main_query() not working for WP REST API
- is there a way to retrieve posts that do not have a featured image assigned?
- Group custom posts by custom taxonomy names
- Custom Post Type rewrite
- How to call a custom post type with WP_query
- Custom Post Types not showing, custom WP_Query
- Admin notice not displaying
- How to Get Current Custom Post Type Selected Taxonomy Term (Not All Terms)
- Can’t get order_by meta_value_num to work properly
- Custom Post Type: Upload Multiple Images
- How can i skip same post from taxonomy term?
- WP_Query | ‘post_type’ doesn’t work
- How to connect two custom post types with nested loops
- Filter by custom taxonomy slug on a custom post type
- Custom Post type and Custom Field WP_Query
- wpdb custom post_type problem
- Pagination on category page with custom post types
- Display multiple custom post types and sort them chronological by one of their fields
- Using DISTINCT in wp_query
- Using global $post; to get featured image for custom post via WP_Query
- Query custom post type in the loop
- right_now_content_table_end function not working?
- How to add pagination to wp_query [duplicate]
- Related posts in all categories of current post (custom post types)
- Taxonomy Archive: Display only one post per term from separate custom taxonomy
- Detect where custom post type is declared
- Metadata for a taxonomy – is there any WordPress way of doing this?
- Loop through Custom Post Type, and then show children within each iteration
- Why does querying on post_tags (which has been applied to custom post types) only return posts?
- Sorting multiple custom post types without a meta key/value pair by sort order
- Including Custom Meta with posts_where query
- Very Slow Page – How to Optimize # of Queries?
- orderby in custom WP Query does not work
- Pagination : How to remove /page/x/ after a ‘POST’ action on a form returning to page 1
- Can I create a loop with multiple post types and specify different $args for each post type?
- How to show CPTs in term archive
- Query custom post type by category slug
- Combining sorted and random CPT
- How to add post_type=value when editing that post type in the WordPress admin?
- Hook to override title, image and content
- Insert Multiple Post with Same Publish Button
- Why is conditionally loading a custom plugin’s code only on a specific custom post type causing the site content to disappear?
- Display CPT posts based on specific taxonomy
- Can’t query tag and post_type at the same time
- Setting proper query for multiple custom admin filters
- shortcode to show custom post types by category
- Unable to retrieve any posts of CPT in wp-admin
- WP_Query: include custom post type only with specific meta value
- Pagination on a custom post type loop
- get_object_taxonomies() returns empty array for custom post type
- showing custom post types of a certain category only
- WP_Query orderby modified to include custom meta changes
- Custom Post Type Loop throws 500 error when used in widget