WP_Network_Query Generator

Overview

Use this tool to create custom code for WordPress Network Query with WP_Network_Query class.

Usage

  • Fill in the user-friendly form.
  • Click the “Update Code” button.
  • Copy the code to your project.
  • Or save it as a snippet and share with the community.

Examples

If you are still learning how to use this tool, check out the following examples:

The variable used in the code.
Show the network loop.
Use comma separated list of network IDs to include.
Use comma separated list of network IDs to exclude.
Return networks from a given domain.
Use comma separated list of domains to include.
Use comma separated list of domains to exclude.
Return networks from a given path.
Use comma separated list of paths to include.
Use comma separated list of paths to exclude.
Number of networks to return.
Number of networks to displace or pass over.
Ascending or Descending order.
Sort retrieved networks by.
Whether to return a network count (true) or array of network objects (false).
Network fields to return.
Whether to prime the cache for found networks.
Whether to disable the "SQL_CALC_FOUND_ROWS" query.
  Save Snippet
// WP_Network_Query arguments
$args = array(
);

// The network Query
$network_query = new WP_Network_Query( $args );