What’s the most efficient way to write multiple WP_Queries on a page?

You could move the query configs into one config array and loop that for querying the posts and rendering the content sections. Inside the content section partial you’d have another loop for the posts.

The magic ingredient here is the third $args parameter you can use with get_template_part(). Use it to pass data to the partial file.

$configs = array(
    'query' => array(
      'post_type' => 'diagram',
      'tax_query' => array(
          'taxonomy' => 'diagram-category',
          'terms' => 'stratocaster-wiring-diagrams',
          'field' => 'slug',
    'template_name' => 'wiring-diagram',
    'heading' => 'Some heading text',
  // more configs...

foreach ( $configs as $config ) {
  $config['query'] = new WP_Query( $config['query'] );
  if ( ! $config['query']->posts ) {
  get_template_part( 'template-parts/content-section', null, $config );

Section partial,

<h2 class="main-heading gold-line"><?php echo esc_html( $args['heading'] ); ?></h2>
<div class="wiring-diagram-results grid-4">
    while( $args['query']->have_posts() ) {
      get_template_part( 'template-parts/content', $args['template_name'] );

The config array could also be placed into a separate file or function and not to have it hard-coded on the template file.