title: Loop through posts with and without children
body: <p>I have this post type that I want to loop through. I have to create two different sections. The top works where it loops through all. But I want to exclude the parent that's holding the children (#6474) and everything in that parent to loop in a different row. </p>
  
  <p>What I have so far. This works in regards of posting all posts. But at the moment includes all parent and children minus #6474. Just want this to show ones that are only parents. </p>
  
  <p>Trying to figure out how to approach creating another row that will only show the children in the post type. </p>
  
  <pre><code>
  $customersPage_args = array (
      'post_type'     =&gt; array( $global_cat ),
      'post_status'   =&gt; array( 'publish' ),
      'posts_per_page'  =&gt; -1,
      'order'         =&gt; 'ASC',
      'orderby'       =&gt; 'publish_date',
      'post__not_in' =&gt; array(6474) //excluding the ID holding the children
  );
  
  $global_cat_query = new WP_Query( $customers_sort ); ?&gt;
  
  &lt;h3 class="h2 display &lt;?php echo $block[className]; ?&gt;"&gt;&lt;?php echo $block_heading; ?&gt;&lt;/h3&gt;
  &lt;div class="card-row"&gt;
      &lt;div class="card u-pb-0"&gt;
          &lt;div class="row"&gt;
          &lt;?php // The Loop
          if ( $global_cat_query-&gt;have_posts() ) :
              while ( $global_cat_query-&gt;have_posts() ) : $global_cat_query-&gt;the_post();  ?&gt;
                  &lt;div class="col-md-3 col-sm-4 col-6"&gt;
  
                      &lt;a href="&lt;?php echo get_permalink(); ?&gt;"&gt;
                          &lt;div class="card card u-mt-0 u-mb-4 align-items-center"&gt;
                              &lt;img src="&lt;?php echo get_the_post_thumbnail_url(); ?&gt;" alt="&lt;?php the_title(); ?&gt;" /&gt;
                          &lt;/div&gt;
                      &lt;/a&gt;
                  &lt;/div&gt;
  
              &lt;?php endwhile;
          endif;
          // Restore original Post Data
          wp_reset_postdata(); ?&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  
  &lt;?php endif; ?&gt;
  
  </code></pre>