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?
- Multisite on Windows with wildcard subdomains
- multisite 404 error for subdirectory
- How to hide or remove unwanted widgets on Multisite installation?
- How to use alias domain for multisite installation?
- Multisite htaccess on localhost with WP as an SVN external?
- WordPress Multisite with multiple domains using Nginx
- Redirect to a Plugin Settings Page After Multisite Site Creation?
- WordPress Multisite – Multiple subfolders for blogs
- Uploading/Deploying a Multi Site Install
- subdomain archiving
- Is it possible to fix/repair all Index, Primary Key, Unique (and all other) structure of a WordPress MS Database
- Trying to migrate a WordPress Multisite with Domain Mapping
- Manipulate list of themes in wp-admin
- How to run nested xargs commands?
- How to add edit users capability to a custom role?
- How to change the database prefix in multisite (WPMU) install
- Getting blank thumbnails in media library?
- Subfolder Multisite : optional www subdomain
- Efficiently manage a huge number of blogs given server-side restrictions
- WP MU – Accessing ‘Domain-Mapped’ WP-Admin with a subdomain
- Accessing multiple sites via FTP
- Multiple homes for multiple languages [closed]
- Icon font not working on subdomains of multisite
- Getting this code to work in Multisite
- Search post in all blogs in WPMU?
- Multi-site: removing /blog from posts
- Multiple install for multilanguage. How to?
- Migrating Multisite – Database error, missing wp_blogs table
- What is the function to get options of the parent site of a multisite network?
- Issue with htaccess redirection in WP Multisite
- WordPress MultiSite login to the respective site
- How to detect the context of homepage for a wordpress mu sub-blog
- Multsite redirecting to the main site
- WordPress MU Domain Mapping Just Redirects to Main Site
- How to make a php script(app) accessible to all wordpress subdomains in a wordpress multisite configuration?
- Multisite with 220+ sites painfully slow
- Multisite: cloning, but also updating too
- Using the standard WordPress “New User” interface on a multisite
- Add multisite switch button. Click to switch to other page in same admin area
- WooCommerce Multisite — importing products IN subsites FROM main site
- Efficient way to handle translations with Multisite WordPress installation
- InfiiniteWP and WP Networks (multisite)
- Restrict Capability of Administrator to Create, Edit and Delete Pages in Multisite
- Why doesn’t wpmu_new_user work from a plugin when it does from theme?
- MU/Subdomains + Domain Mapping + SSL?
- Simplest way to query with blog_id?
- WordPress Multisite – Load users using custom query
- How to wordpress multi site [closed]
- Is it possible to load wp-content/uploads from another server?
- Domain Mapping subsites of an Add-on Mulsite Domain
- Trying to change active theme on all sites in Multisite
- Multi-Site / Single Site Decisions
- Multi-site site nav, wpdb->prepare missing argument
- Publish all network posts to the primary site
- Multisite subdomain-site redirects to primary site
- query multisite blog for post by tag
- WordPress Multisite on multiple sub-domains
- How to migrate post media from stand-alone to multisite build
- Multisite network admin login redirect
- Seeking solution to sync wordpress sites with Server
- Multisite with Different URLs on Local Server
- How to add WordPress site to multisite network when both are addon domains
- Get posts by user role in a Multisite
- WPLANG option not available in localhost
- How can I make my existing VIP theme to multisite
- how to make a cronjob run, when user needs to be logged in
- After cloning my WordPress database to another server, I cannot log in
- All Subsites of a WordPress Multisite install 302 redirects to the main site
- How to find the site ID on a single site and then add new post with “`multipart/form-data” enctype?
- WordPress Domain Mapping shows new domain in place but takes me to the sub domain
- How can I have different langauges in wp-admin on a multisite installation?
- Problem in viewing recent posts from network site to main site
- Send data using GET method not work correctly
- How to create Network of websites with separate database in WordPress
- WordPress multidomains and subfolders
- Create service similar to wordpress.com [closed]
- 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?