A custom post_type is a type of post that has a unique name, like ‘event’ or ‘book’ depending on the type of object you are needing. This can be anything. The post_type ‘post’ is a built in WP post_type and concerns only blog posts in the “Posts” panel of the admin area.
Add 'post_type' => 'your_post_type_name_here'
for the post_type you are needing to your WP_Query() arguments.
Hope this helps!
Related Posts:
- What is an efficient way to query based on post_meta?
- Use REGEXP in WP_Query meta_query key
- Add indexing to meta_value in wp_postmeta
- Getting attachments by meta value
- WP_Query not working as expected for attachments and custom meta_query
- How can I create a WP_Query that returns posts where one meta_value
- WordPress altering my custom query, How to fix it?
- WP Meta Query for some meta (array) values
- How to get sum of meta_values of a meta_key in wp_query according to conditions
- Order posts by meta value and Date
- Get meta info related to current post
- How to make Meta Query case sensitive?
- Performance when getting post meta for post retrieved by meta value
- Get attachment by meta_key value
- Fetch Record based on meta key dates
- how to make members list directory through wordpress post custom meta key.
- Large AND OR query timing out
- database query with more than a couple meta hangs and doesn’t complete
- Filter posts by comparing custom meta value against postdate
- How to set up hierarchical relationships without using plugins / meta query
- Nested array issue in meta_query
- Query posts by searching for a string in a meta field
- WP_Query meta compare must include ALL array values
- How do i create a custom post query when the meta value is an array?
- wp query to use both author id and meta_query
- Meta query ignores multiple values of the key
- Trouble with serialized metadata
- show most viewed post
- Why can my filter query SOME metadata but not other metadata?
- Query against multiple locations within single custom post type post
- update_post_meta performance in a loop woocommerce
- update_post_meta performance in a loop woocommerce
- How to set meta_query if get_post_meta returns nested array for that key? [duplicate]
- Saving custom fields for WP_Query to retrieve
- How to show all the associated posts with specific date of data metabox?
- WP Meta Query at depth 2
- WP_Query Posts by Metadata from Option Tree
- Return a single custom post from multiple meta queries
- 294 Queries on Mainpage of WordPress
- Order by meta_key doesn’t work
- WP_Query of custom post type sorted by meta_key has unexpected results
- Using Transients
- Check if searched number is within the post meta value
- Meta query compare for ID’s greater than specific ID
- Appending to existing WP_Query’s meta_query if exists
- Issues with search after added meta_query
- Sort by presence of thumbnail
- Display posts with specific value first in query
- Get every post with value in meta key
- Slow Query On Search
- it’s possible make a WP_Query with math operations?
- Multiple meta_key ordering with pre_get_posts
- how to write wordpress query for multiple metakeys checking?
- Sorting search results with custom dropdown
- get_page meta query not working, maybe a bug?
- WP_Query: apply an SQL function to meta fileld value
- Wpdb->query result show 1 but is not an integer
- How to search for meta_query LIKE or tax_query LIKE and grab these posts on search results?
- How to create dynamic value in WP_Query meta_query
- Is it possible to add relation between meta_query and tax_query?
- Why having more than 10 clauses in WP_Query results in some outputs being dropped?
- Woocommerce: order posts by meta key
- Get meta_value of a specific meta_key from all posts belonging to a specific custom type
- Custom query filter by ACF date custom field
- Order WP_Query results by meta key value in custom query
- Storing an array of objects related to each user
- How can I update post meta inside a WP_Query loop or the WordPress loop?
- Query by date from custom field
- Retrieve data from wordpress db via input and put those result in dropdown
- WP Query – filtering terms with regex
- Is it possible to retrieve posts depending on meta_key LIKE condition? [duplicate]
- query post by author gender
- WP_Query with page_ids in arguments without a result
- Error in meta_query not get result
- Display post meta conditionally based on it’s value
- Function to retrieve IDs of posts, cache results, and improve wp_query
- Filtering by multiple conditions in the loop
- add_query_arg to compare and display events from a certain date
- How do I add an item to the WP admin menu?
- Multiple meta query from array
- Meta query with compare by more than 2 fields
- Show single posts date, in a page of posts
- WP_Meta_Query object with conditionals
- Sort by custom field that is an array?
- Comparing 2 Decimal Numbers from custom fields and displaying posts
- Orderby two meta fields not working
- Issue with data array format
- How to get current page nearest parent id?
- Display count number of posts with the same specific meta_key meta_value
- WP Query / Meta Query [duplicate]
- meta_query with array as value with multiple arrays
- Why doesn’t my WP Meta Query return any results?
- WP_Query with 4 post meta field arguments gives 500 internal server error
- WP_Query Class custom field parameters
- meta_query returning excluded result
- Use have_posts() with array of post results retrieved by $wpdb->get_results
- WP_Query not returning correct result with meta_query parameter
- What’s missing in this wp_query and meta_query
- Sort posts using multiple custom fields and menu_order in single query?
- meta_query where the meta value is not the post title