PHP code example of devaloka / network-wp-query

1. Go to this page and download the library: Download devaloka/network-wp-query library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

devaloka / network-wp-query example snippets


 $query = new WP_Query(['network' => true]); 

 $query = new WP_Query(['network' => true, 'sites__in' => [1, 2, 3]]); 

 $query = new WP_Query(['network' => true, 'sites__not_in' => [1, 2, 3]]); 

 $query = new WP_Query(['network' => true, 'posts_per_site' => 1]);