Found solution
$posts = array_merge($posts1, $posts2);
function cmp($a, $b) {
return strcmp($a->post_title, $b->post_title);
}
usort($posts, 'cmp');
Related Posts:
- Using page slug in wp_query
- Query when is one or several values
- How to manage wordpress knowledge base/wiki/posts collections
- Query all posts where a meta key does not exist
- Exclude a category from WP_Query
- Single loop for wp_query and wp_user_query
- WP_Query orderby custom field then post_date in one query
- query multiple taxonomies
- Custom Post Type, WP_Query and ‘orderby’
- Include post id[s] into WP_Query()
- Grab 5 latest posts from custom post type ‘announcements’
- WP_Query to loop a Custom Field, Custom Post Types do not show
- Pagination Doesn’t Work
- Numeric pagination custom post type
- Using Query Posts With Multiple Post Types And A Taxonomy
- List with categories, subcategories and posts of custom posttype
- Sort the main query in subcategories/terms?
- Custom Taxonomy List links being re-written
- Can’t sort order of wp_query with 2 meta keys
- Get post info inside modal window?
- Want to filter only parent post in admin area
- Get count of custom post type created by current user
- Query Custom Post by Category
- Pagination Issue: Custom Post Type In Index
- Having trouble with custom date field for CPT query (WordPress)
- Quickest way to get last or oldest post date – WP Query
- WP_Query and using a variable for ‘cat’=> in the args array = WP Bug?
- Custom post query by taxonomy
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- CPT posts listed by category with custom rewrite URL, please help!
- How to use WP_Query in a CPT achive page?
- Use get_post_types to query only custom posts types
- Group custom posts by custom taxonomy names
- How can i skip same post from taxonomy term?
- Query custom post type by category slug
- Can’t query tag and post_type at the same time
- Pagination on a custom post type loop
- WP_Query orderby modified to include custom meta changes
- Wrong request query on cpt and tax
- Search / Filter posts on Title/Content OR Tags
- Converting the_content string to an array?
- What’s the WP way to load remaining custom posts?
- Several post types on WP Query by tag and taxonomy
- Filter Posts from the Main Query
- Pagination with custom query, custom search form, single and pages, ajax and no plugins
- How can I group posts by months and years?
- Display post from a date range from custom field
- Displaying a div from an assigned meta_value when on a page
- Creating two loops based on different logic
- Getting a custom post’s custom field based on another custom post’s custom field select
- Custom post type loop with custom category filtering
- Show message when query has no posts
- How to show all taxonomies within custom post type loop
- WP_Query not resetting after wp_reset_postdata
- Custom post type to lead to single post type instead of shortcode modal
- Custom post type is using the index.php template
- Filter posts of custom post type by meta key in (List All Section)
- Query Posts that have Custom Taxonomy
- Display post from custom post type
- Query Posts, order by meta value
- Foreach loop returning more than one item when querying taxonomy
- Custom Post Type – Main page for certain posts
- display two images in theme header.php file
- how to compare different timestamps in wp-query for events custom post types?
- Sorting the Loop by Taxonomy Value
- Previous / Next Links For Custom Post Type Sorted By Meta_Value
- Custom Query: Multiple CPTs and a taxonomy filter
- Ordering by meta value not working
- Create if else for post types in WP_Query ‘post__in’ values
- Custom post type query with taxonomy
- DIVI Theme customizer changes not applied on existing pages and designs are not shown on the front
- Search Function not searching correct custom_post_type even though post_type is defined in search args
- How can I fetch all the dates from custom fields from various different custom post types and show / list them at one place in ascending order?
- 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
- Custom Post By Category
- Mix Facebook and Twitter feed into custom posts
- pre_get_posts gives 404 error on Custom Post
- Query for a custom post taxonomy
- Get post from Category by Priority
- WordPress loop multiple orderby query with Types toolset
- Strange behavior on WP_query
- Get posts associated with custom taxonomy alternate way
- display news with pictures 3 small and one large (loop)
- 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
- Trying to combine multiple WordPress queries
- Listing all custom post types using a specific term on the said term’s template page, in groups
- Querying meta values within an array
- Filter Custom post type by another Custom post type
- Archive page – problem with pagination
- Are custom posts included when getting a categories’ posts?
- Quering array of post types & pagination. Articles are repeating sometimes on different pages
- How can I show posts with the same tag?
- Load posts via AJAX without draft status
- WP Query – Can’t get posts with specific taxonomy