You’re missing the fact that get_posts()
(or WP_Query
) can take an array()
of post types in a singular query. More info on Type Parameters in the Codex. The order will per default be the publishing date.
You can then specify it further by adding in stuff like your taxonomy_query
, etc.
Keep in mind that you can orderby
by meta_value
as well as assigning multiple orderby
arguments space separated:
'orderby' => 'meta_value post_date'
for example.
Related Posts:
- Adding a span when custom post type is updated
- Display children and grandchildren of a custom post type
- WP_Query search posts by custom post type and custom taxonomy
- Conditional to modify query results
- 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?
- Can’t get order_by meta_value_num to work properly
- Taxonomy Archive: Display only one post per term from separate custom taxonomy
- Very Slow Page – How to Optimize # of Queries?
- How to make sure content doesn’t display if selection is empty
- creat filter with wp_query
- Configuring a meta query with multiple post types that have the same relationship on a single page
- How can I group posts by months and years?
- Loop increase number
- Using wp_query to modify the loop in index.php for a CPT
- WP_Query Custom Post Type if Category ID Equals
- Is This Code Efficient – Or is there a better way?
- Different options per post type in WP_Query
- Show message when query has no posts
- Undefined $post in wp_query
- Custom post type and custom taxonomy 404 on page 2
- List latest post out of 2 custom post types
- Using Wp_Query, Json to add Highcharts series data
- foreach loop inside the loop creating duplicates in output
- Foreach loop returning more than one item when querying taxonomy
- Page that lists publications by classifying them by taxonomy
- set object terms after some some time of published post – functions.php
- Alike Shortcode using in Custom Shortcode
- Query custom post type that has a serialized relational advanced custom field value
- Sort custom post column by generated value?
- WP_Query – How To Query Only Custom Posts With No Children of Their Own?
- wp_post_delete is deleting all offices
- Tell wordpress to show a single page instead of an archive page
- Search result based on URL
- Custom Taxonomy – fields
- Custom Post By Category
- How to get the posts that my following users are liked?
- CPT post doesnt shows tags and category on backend admin page
- The most recent post of custom taxonomy
- WordPress loop add heading before first of type
- How to make a shortcode for my WP_Query Loop? [duplicate]
- Strange behavior on WP_query
- get_post_meta for Custom Post Type ( CPT )
- Loop carousel slider in wordpress
- Values inside a custom field to determine which category posts to display
- Trying to combine multiple WordPress queries
- Custom Post-type not returning the right child_of
- Pagination not working on homepage
- Query Custom Post Type by Tag
- How to manage wordpress knowledge base/wiki/posts collections
- Store custom post type with JSON content
- Exclude a category from WP_Query
- Single loop for wp_query and wp_user_query
- query multiple taxonomies
- Include post id[s] into WP_Query()
- Grab 5 latest posts from custom post type ‘announcements’
- Pagination Doesn’t Work
- Sort the main query in subcategories/terms?
- Get post info inside modal window?
- Pagination Issue: Custom Post Type In Index
- Having trouble with custom date field for CPT query (WordPress)
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- Order WordPress Custom Taxonomy Pages & Pagination Not Working
- How to use WP_Query in a CPT achive page?
- Use get_post_types to query only custom posts types
- How can i skip same post from taxonomy term?
- WP_Query orderby modified to include custom meta changes
- how to check if custom post type column already exists?
- Can I list a custom post type within another custom post type in the admin area?
- Filter Posts from the Main Query
- Display post from a date range from custom field
- WordPress: Custom User Role cannot access Custom Post Type | “Sorry, you are not allowed to access this page”
- Custom post type to lead to single post type instead of shortcode modal
- Filter posts of custom post type by meta key in (List All Section)
- Display post from custom post type
- Query Posts, order by meta value
- WordPress sitemap with Custom Post Types
- How can I sort the order of multiple custom field values in a custom post type?
- php dynamic content inside shortcode
- I want to rewrite the URL of a specific post with a specific custom field to easily analyze in Google Analytics
- Taxonomy doesn’t follow slug permalink structure
- Looping to organize and display custom posts by category using PHP and WordPress
- How to use multiple orderby conditions on query search results? (orderby one post type, relevance)
- Query a custom taxonomy in a function to create an csv file
- Display a list of sub-pages of Custom Post Type Parent Page
- test if something is a post or a taxonomy
- Mix Facebook and Twitter feed into custom posts
- ACF Post Content Not Being Searched
- Get post from Category by Priority
- Getting a 404 on single custom post type page when using rewrite on a custom taxonomy
- tax_query showing no results
- Can’t use orderby in WP_Query
- Custom post type blog pagination conflict
- Custom post type pagination, single page issue
- How to display elements of different post types?
- display post types alternately
- Querying meta values within an array
- Archive page – problem with pagination
- Assign a tag to custom post type using a query
- Query order by a numeric ACF field