You won’t do much good just merging the arguments, you need to merge the resulting posts array and the post_count count. This works for me:
//setup your queries as you already do
$query1 = new WP_Query($args_for_query1);
$query2 = new WP_Query($args_for_query2);
//create new empty query and populate it with the other two
$wp_query = new WP_Query();
$wp_query->posts = array_merge( $query1->posts, $query2->posts );
//populate post_count count for the loop to work correctly
$wp_query->post_count = $query1->post_count + $query2->post_count;
Related Posts:
- Querying posts from multiple sites in a network?
- How do I query all posts of one type across my multisite installation?
- find a random blogid across my multisite network that has at least one post published
- BP Multi Network & Members Directory [closed]
- How do I Use Nested Loops of Custom Post Types for MultiSite Blogs using WP_Query()
- Switch to blog and get content from that blog
- How to show only blog-domain instead of the whole permalink in the loop
- Simplest way to query with blog_id?
- the_content not working on one of two Multisite sites
- Remove W3 Total Cache minified files on custom page outside of WordPress [closed]
- Fastest way to fetch posts across a multisite
- Multisite redirect loop for a single www domain
- In a loop, do not display content that does not have a thumbnail
- Can I force WP_Query to return no results?
- Moving a WP Multisite to a subdirectory
- WP_Query vs get_posts
- $wpdb->base_prefix not get parent site prefix in multisite
- what are pmxi tables? [closed]
- Restrict Admin Capabilities in MultiSite
- How-to exclude terms from the main query the most performant way?
- Pagination with WP_Query is buggy – working for some pages, but not the others
- Get the number of posts from the current page results
- Multisite 404 errors and non-www redirecting to home page
- Multisite, turn off “create new site”
- Hard Code Pages into a Theme for a Network (multisite) Installation
- Multisite with entirely different domains?
- Testing Multisites with vagrant or Can I use multisite with only an IP address (without domain name)
- Injecting content with $wp_query->current_post restarts from zero on paged pages. How to inject content after X posts, regardless of pagination?
- How To Modify New Sub Blog Immediately When Super Administrator Creates It?
- Can you set up a wordpress (multi-site) network to work across multiple hosting accounts?
- No Network/Super admin after enabling Network
- Creating a Post form outside of the Admin
- How can I create a multisite global tag cloud?
- Possible to create a multisite network where the main site is non-WP?
- User registration on sub site
- Override database config for WordPress multisite
- Multiple WP Sites Same Server – Share WP Base?
- Poor performance on multisite install
- Create ONE callback for all page templates, post filter queries + paginated pages, triggering pagination via AJAX
- Super admin access to a forgotten WP instance?
- Auto Redirect after login
- Show one item per category of a custom post type
- Iframe being removed only for some users when publishing a page
- Start with multi-site feature now or later?
- Adding new sites to Multisite won’t register in Dashboard
- ‘Cheatin’ uh?’ Error When Attempting to Upload Images After 3.4 Update
- Add menu items/actions for multisite users who are registered on the network but do not have a role or capability in any sites
- WordPress Multisite with Addon Domains (not parked domain) [closed]
- Blocks Rest API rest_cannot_delete
- htaccess file for multiple CMS’s (multisite wordpress + wolfcms) on same domain but different subdirectories
- Multisite with different domain names on different servers
- Insert content of a post into another
- Redirect One Multisite to Another
- Multisite Installation is all the same site
- Some doubts related to Multi Installation → Media of one of the site can be used on the others?
- Redirect to localhost after installing Multisite on server
- How to : pagination in 3 different custom loops on the same page
- single sign on for wordpress multi site
- WordPress multisite install on two subdomains, each belonging to a separate domain
- Navigation menu not being assigned Theme Location
- Moving wp-admin folder to a different host in a multisite environment
- How do I remove the “http://” from network_site_url?
- Mass Update Broken Links
- Display an image if odd number of posts in grid
- Performance disadvantge of second installation instead multisite feature?
- What is the simplest way to disable multisite leaving one of the sites only?
- What does multi-site WordPress application mean?
- Exclude recently updated post from custom WP_Query using multiple loops
- get_posts output always same post
- difference between querying database and using the loop
- Stomping WP_Query in author archive to facilitate pagination with custom queries
- Add wordpress multi sites with different port number from 80
- Loop posts based on permalink term
- Create website with a switch between private and business [closed]
- Can’t create a subdomain network – and WP is installed in webroot, not a folder
- Does putting queries within loops cause an issue on WordPress?
- Forward and mask a WordPress website
- Subdomain is not working
- How to automatically create an index of child sites at the root url for a multisite installation?
- the_post(); prints out style text into my HTML?
- Does switch_to_blog support array or other ways to show all posts on a network install?
- How to make subdomain and muti-site but wordpress isn’t in root?
- Migration: previous URL redirection after migrating
- Add www to the Root Site in WP Multisite Network
- URLs for (MultiSite) link images are always relative
- How to allow mixed case characters in multisite site name?
- Double loop output
- How To Change the URL of a WordPress Multisite
- Create multiple sections for all categories and then queries all the posts for each of those categories
- Site w/ Addon Domain doesn’t show CSS
- WordPress MU – Creating a site takes ages
- Printing direct descendants of a category with WP_Query
- Default sub-pages on WordPress Multisite
- WordPress Multisite – Questions about select all posts from all network sites
- Custom loop won’t work, can’t find problem
- Multi site and media uploader
- Comment reporting for Multisite
- How to display the most popular posts of all the blogs in a mu setup? [duplicate]
- Subdomain add comment redirect to 404 not found page iis server
- How to get posts by a certain author in inner loop using outer loop variable or post title WordPress