That would be nice if you query all three post_type
s at the same time, using one query, and then manipulating it using php
.
Consider this query:
$args = array(
'post_type' => array( 'pt1', 'pt2', 'pt3' ),
'meta_key' => BUMP!!!!
);
You can not use an array of meta_key
s.
So, I think the only way is to use wp_db
object and make your own custom query:
$results = $wpdb->get_results(
"
SELECT ID, post_title
FROM $wpdb->posts
WHERE post_type="pt1" OR post_type="pt2" OR post_type="pt3"
AND ...
"
);
foreach( $results as $result ){
echo $result->post_title;
// ...
}
and then use php
to separate and show the results.
Related Posts:
- Find out total number of pages in global query on archive page?
- Resetting post data to previous loop in nested loops
- Order by multiple meta key and meta value [closed]
- Is it possible to completely stop WP_Query retrieving posts?
- Order by optional meta key?
- Make loop display posts by alphabetical order
- WP_query to get the first two latest posts, then another loop to get the next three
- Why is WP_Query not working with category_name?
- ‘Trying to get property of non-object’ when using WP_Query with ‘fields’ => ‘ids’
- Displaying several specific pages using WP_Query()
- WP-CLI How to generate a list of posts with corresponding meta values
- Query to return maximum of one post per author
- Get attachment by slug
- RSS feed with specific keyword
- Get All IDs Of A Post Type Using WP_Query
- Warning: urlencode() expects parameter 1 to be string, array given
- Group posts by custom field
- Multiple endpoints in one URL
- How to get the posts published in last two days using WP_Query?
- getting posts and number by specific meta value in multiple meta
- How to query using a combination of custom_field values?
- Get attached media only
- Can not switch the queried post in pre_get_posts hook
- how to fire join query with post_meta
- Show one post per author and limit query to 8 posts
- Get term by custom term meta and taxonomy
- Filter by title content and meta key at the same time
- Get all remaining posts after a particular post id
- wp_query with multiple custom fields
- Removing posts from the returned wp_query. Cannot use object of type WP_Query as array
- So strange result of wp_query and have_posts
- Minimising number of queries on a page when using Advanced Custom Fields
- $wpdb insert is not work
- WP_Query Ignoring `post_type` parameter
- How to find exact match for search term in WP_Query? What is the additional string added in LIKE query in WP_Query?
- Improve wp query perfomance on large db
- If two first numbers exist in wp_meta_query value
- How to get the WC_Product Object when using a WP_Query in WooCommerce
- How to query for posts without a post_format
- get_posts – find out if querystring was crap and fallback is used
- Custom Search Result Page displaying only 1 result.
- How to query a custom post type with a taxonomy filter but display post type archive page?
- How to display 7 most recent days of posts?
- WP_Query Variable inside Array
- Function get_queried_object() return NULL in custom taxonomy
- Search pages that are a child of the current page
- Change query_posts to WP_Query in page but does not work
- The pagination on index.php doesn’t work on a first page
- Include tags in WP_Query
- Modify WP Query post__in before have_posts()
- WordPress multisite – fallback on subsites to main site on 404 and dealing with switch_to_blog function
- WP Query using tax_query & meta_query
- How to control a common terms list from one place?
- Exclude Category filter from Portfolio section
- Search form not working with custom query?
- How to output topics and replies in bbpress as table?
- Is there something wrong w/ this code?
- how to access query string in wordpress?
- Query Vars Not Set in Main Query
- ACF Query Structure
- Order post type by sum of two custom fields
- exclude product with available tag
- Need help understanding this WP Query [closed]
- Ordering posts by custom field and grouped by month
- How to get main menu only with wp_nav_menu
- relation OR instead of AND – Filtered term ID’s in loop
- filter posts by meta key with pagination
- Ajax (jquery) wp_query pagination returns -1
- Query to get result by Title or Meta along with tax_query parameter
- Oxygen Repeater Advanced Query
- Why are my wp_query args being ignored if post_type = CPT
- Use dedicated functions
- Woocommerce Get Orders By Meta Value
- Pagination not working on archive.php template?
- Save large WP_Query to transient === false
- WordPress Query optimaization for slow query
- WordPress – just refresh blog archive by new query
- how to move a page from one drop down menu to another drop down menu
- WP_Term_Query->get_terms() very slow query for WordPress filter
- Meta query doesn’t remove placeholder escape before query
- Multiple values in WP_Query : category__and
- Get all wp_users sort by metakey
- How to use wp_query in different column in single loop
- Paginated Post List on Front Page
- Query custom meta value – post view and date meta
- Show subscriber id in loop
- modifying the loop multiple times with arguments passed through ajax to wp_query
- WP_Query – show posts where meta value and user_email match
- WP_Query causing links to not work
- Website goes slow down after importing long database
- Pagination for custom query throws 404 errors on last pages [duplicate]
- Order posts by custom column using pre_get_posts
- How to Query Updated Post in WordPress
- wordpress nested loop
- Need help setting up a search form for wordpress [duplicate]
- Including ‘cat’ => $cat breaks meta_query
- problem in query_vars parameters
- Query posts only shows 1
- First post outside of loop, homepage only?
- WP_Query filter Posts by timestamp event (range start and end) and by month (next 12 month)