Could you do something like this?
<?php
$args = array(
'post_type' => array('post','movie','actor'),
'posts_per_page' => '20',
);
query_posts( $args );
while ( have_posts() ) : the_post();
global $post;
if (($post_type == 'movie') && (get_post_meta($post->ID, 'meta_key', true) == 'your-value')) {
// Display your content for Movie Post Type with meta value set
} else if (($post_type == 'actor') && (get_post_meta($post->ID, 'meta_key', true) == 'your-other-value')) {
// Display your content for Actor Post Type and Other Meta Value
}
endwhile;
?>
Related Posts:
- Quering array of post types & pagination. Articles are repeating sometimes on different pages
- Custom post type archive 404’s with paginate_links
- WP_Query ignores post_type in category view
- Display Custom Post Type Fields
- Retrieving 3 latest post from each of 5 different custom post types
- how to group custom post type posts by custom taxonomy terms
- Using Query Posts With Multiple Post Types And A Taxonomy
- How to get the parent’s taxonomy?
- Adding a term name from a custom taxonomy assigned to a post link displayed by a wp_query loop based on another taxonomy
- Query not returning CPT posts
- Unable to display multiple post types in same query (WPML WP_Query)
- Query for posts in 2 taxonomies
- Quickest way to get last or oldest post date – WP Query
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- Custom query shows custom post types in trash
- Use get_post_types to query only custom posts types
- WP_Query | ‘post_type’ doesn’t work
- Sorting multiple custom post types without a meta key/value pair by sort order
- Display custom post type from dynamic custom field
- Query/list all terms and their custom post count
- Archive for custom taxonomy lists all posts instead of current taxonomy
- child of post type (custom)
- Get latest 3 posts from multiple CPT in one query
- Polylang non-default language ignores tags in WP_Query
- Different Ways to Query Custom Post Types?
- pagination not working for category.php (custom post types in categories)
- How to display Related Posts based on number of taxonomy terms matched
- How to make WP_Query not to show irrelevant posts?
- Loop for custom post types filtered by a taxonomy
- Custom filter for main search: how to exclude specific post_type from search results
- Custom post type, custom taxonomy, query posts only from taxonomy (children of)
- Pagination not working on custom query on a page
- find custom post type post by searching its custom field with my string
- FacetWP paging custom wp_query
- Custom post type and standard post not displaying or working
- Can’t change posts per page in WordPress Post Type Query
- postsperpage value not being applied
- Post Type => Any conundrum
- Custom Post Type Query W/Category Dropdown
- Find Posts based on Child Post value
- Custom Post Type ‘Event’: Chronological list of recurring events from meta_values in array
- Sorting the Loop by Taxonomy Value
- Custom Query: Multiple CPTs and a taxonomy filter
- WP query_posts group by meta field related
- Custom wp-query display post only today
- custom post type and a “sticky” position taxonomy
- Use WP_query to match post types based on custom field values
- minimize wp_query call to database
- Query the title of the page to show posts with matching category in the loop
- Main site single-property.php design, as homepage of a multisite
- Imported Content Doesnt Show Up On Frontend
- WordPress custom post type
- display news with pictures 3 small and one large (loop)
- Custom Query With Multiple Meta Key Value
- Custom post type blog pagination conflict
- Query Posts From Multiple Post Types
- send user to first page of results when reposting to page?
- Why does ‘exclude_from_search’ exclude a custom post type from WP_Query?
- How do I correctly query posts from a post ID?
- How to exclude certain portfolios from a loop
- Display ACF object field data using Elementor Custom Query
- Assign a tag to custom post type using a query
- How to use a custom post type archive as front page?
- How to make a WP_Query search with custom post types?
- The Operator “NOT IN” Does Not Work In tax_query
- WordPress query by multiple Custom fields and order by date
- Help with hierarchical custom taxonomies and permalinks…almost there
- ascending order custom post type
- New WP_query in template not working with CPT+category on some pages
- How to get only one category of custom post type?
- Optimised Code for Pulling Taxonomy Posts
- How can I get the first 50% of all posts (within a custom post type)?
- Storing posts from query and accessing later via AJAX call
- Return one unique custom post type result when it shares a custom taxonomy in WP_QUERY?
- Query Custom posts of same taxonomy as the post itself
- Show only one post on custom post type archive
- Category with post type pagination returns 404
- Pagination issue on category.php using custom post type query
- Listing all term items alphabetically / sorting loop
- How to sort a WP_Query by a custom field AND ALSO filter by a different custom field
- Get current user id
- List latest post out of 2 custom post types
- How to properly use Categories with Custom Post Types
- Pin posts to top of custom loop
- WP_Query – How To Query Only Custom Posts With No Children of Their Own?
- Foreach result into WP_query
- Query custom post type and custom field by URL parameters
- Custom Taxonomy – fields
- CPT Loop, include taxonomies and disclude others?
- How to use costum database table for custom post type
- Querying, storing, and using data from 2 separate custom post types
- date_query won’t accept day parameter, but will accept month and year for a custom post
- do action inside a class is not working
- WordPress custom post type queries
- Custom Post ‘Post Per Page’ Crashing Page?
- Query Distinct Taxonomies of Custom Post Type
- Paged within a custom content type template [duplicate]
- Query by post type or category
- How to add post type in masonry posts elementory widget
- show the most recent date of all posts to display on front end