If you want to work with it just like with WP_Query, you can use this construction.
$query = new Network_Query( array(
'blog_id' => array( 1, get_current_blog_id() ),
'posts_per_page' => 5,
'date_query' => array(
'after' => date('Y-m-d', strtotime('-1130 days'))
),
'meta_query' => array(
array(
'key' => 'shows',
'value' => $id,
'compare' => 'LIKE',
)
)
) );
if( $query->have_posts() ) :
while( $query->have_posts() ) : $query->the_post();
endwhile;
endif;
So, we merged the current blog and the blog with ID1 into a single loop.
To make the Network_Query work on your website, additional plugin is required https://rudrastyh.com/plugins/get-posts-from-all-blogs-in-multisite-network
Hope it helps.
Related Posts:
- How can I trust switch_to_blog()?
- Sharing Dynamic Sidebars across Multisite Blogs
- How would I use pre_get_posts to query another site for posts in my multisite network?
- latest 5 posts using switch_to_blog loop
- Switch_to_blog() outside wordpress
- why when I try to insert an image attachment along with a post does wp_get_attachment_url give me a very wrong file path?
- Upload images from one site to another in Multisite
- What is the way to share data between sites in a multisite
- get post id by $content (so by post content)
- Register submenu on network menu from the subsite
- Sort posts according to date
- Multisite switch to blog
- Best Practise: Linking to WPMU sites from other sites
- Trouble with SQL SELECT inside switch_to_blog()
- Display posts from one network site on another
- Get variable from previous blog while using switch_to_blog
- switch_to_blog($blog_id); still writing to main blog
- fatal Error undefined function switch_to_blog()
- How to get all pages on specific blog after switch_to_blog?
- Do “switch_to_blog()” and “restore_current_blog()” re-run the filters?
- Access from template info of another blog (in the same network)
- Get the excerpt by page ID from another blog in a wordpress multisite?
- Memory growth with new additions to WordPress Multisite
- Is there a is_user_logged_in() for multisite?
- Switching MultiSite installation from HTTP to HTTPS
- Switching primary site in WordPress Multisite
- Multisite Network Port Num Issues?
- $wpdb->base_prefix not get parent site prefix in multisite
- what are pmxi tables? [closed]
- Use wp_nav_menu() to display a Menu from another site in a Network install?
- How to set an option for all sites in my network?
- How to set up wordpress domain mapping on MAMP Pro
- How to hide admin account in BuddyPress? (for security reasons)
- Issue with Custom Roles in Multisite
- Automatic Upgrade Filters in Multisite
- Force plugin to be activated only from multisite network dashboard [duplicate]
- Delete sites in wordpress multisite (not suspend)
- wp-cli is not working properly. No response from commands
- Unable to login to new custom domain on multisite?
- Generate WP-CLI @alias for each site on multisite
- Shared Content but “Updatable” Through the Main Site
- How to customize the wp-signup.php for a multisite network?
- Get first_name and last_name on user_register hook
- User registration on subsite in multisite configuration
- Multisite, turn off “create new site”
- Hard Code Pages into a Theme for a Network (multisite) Installation
- ID’s being stripped out of editor for Admin user in Multi-Site
- Change management solution for BP-based site?
- How to Structure WordPress for an Organization and its Departments?
- Allowing logged in users to comment without moderation across a multisite installation
- Redirect all users, except network administrators, from the main site to a subsite
- Multisite non www domain gives registration error but should redirect to www.domain.com
- How to get the via url (or site name) on a wordpress network’s home page?
- How To Modify New Sub Blog Immediately When Super Administrator Creates It?
- WordPress multisite htaccess
- get_current_site() not returning site name
- Create New Site (multisite); can’t get subdomain to work
- Subdirectory multisite – only root admin available on NGINX
- How to Run Code Before a New Site is Created on MultiSite for Validation
- How to use JSONP to make AJAX request to different site on network
- User registration on sub site
- Add custom user fields in Multisite USERS page
- WordPress multisite with multiple parent domains
- WP 4.4 – domain mapping for sites within a multisite network?
- Can I use two different domain names with a WordPress multisite network?
- Restrict Admin Capabilities in MultiSite
- Installing multisite on domain with existing subdirectory wordpress installations
- wp_redirect not working on admin menu page
- Bootstrapping WordPress MultiSite Outsite of WordPress – No $wpdb
- Poor performance on multisite install
- Super admin access to a forgotten WP instance?
- How to disable the default WordPress redirect to non-www URLs?
- Bulk theme settings in wordpress multisite
- Permalinks not working using wordPress Networking with custom post types
- Should I use a multisite installation to achieve a multi-language site?
- Multisite domain naming
- Site kit Google Analytics setup giving Error: {“error”:”invalid ‘redirect_uri'”}
- All pages have 302 redirect, which I can’t remove
- Can is_page and is_front_page both be true?
- Iframe being removed only for some users when publishing a page
- Switch a single site to a multi-site
- Start with multi-site feature now or later?
- migrate a MU sub blog to a single install
- Add menu items/actions for multisite users who are registered on the network but do not have a role or capability in any sites
- Preferred method of setting user role only works on Main Site in Network
- WordPress Multisite with Addon Domains (not parked domain) [closed]
- How to share primary navigation of main site with subsites usining switch_to_blog
- WordPress 4.5+ Multisite Domain Mapping
- Redirect to localhost after installing Multisite on server
- new multisite, old db
- Multisite sub-directories IIS 7.5 change media/uploads location
- One Domain, Two Installs of WordPress
- add_rewrite_rule not working in WordPress Multisite
- WordPress multisite install on two subdomains, each belonging to a separate domain
- wordpress multisite with already existing subdomain
- Why the sites dropdown in multi-site installation is different from the list of sites when seen full page?
- WPML is blocking WP core update
- Multisite: Redirect a deleted site – Best practice?
- Unique wordpress multisite requirement
- Child sites are slowly loading images from main site (main site is super fast)