diff --git a/taxonomy-company.php b/taxonomy-company.php
index 449a774..f1f1d28 100644
--- a/taxonomy-company.php
+++ b/taxonomy-company.php
@@ -155,13 +155,31 @@
image_id )[0];
- $colour = get_term_meta( $parent->term_id, 'color', true );
- $colour = ( '' !== $colour ) ? $colour : 'transparent';
- ?>
+ // Filter out parents with only private roles associated.
+ $parent_args = array(
+ 'posts_per_page' => - 1,
+ 'post_type' => 'job',
+ 'tax_query' => array(
+ array(
+ 'taxonomy' => 'company',
+ 'field' => 'slug',
+ 'terms' => get_term( $parent->term_id, 'company' )->slug,
+ 'include_children' => 1,
+ ),
+ ),
+ );
+ $parent_jobs = new WP_Query( $parent_args );
- - term_id, 'company' )->name ); ?>
-
+ if ( $parent_jobs->have_posts() ) :
+ $img_url = wp_get_attachment_image_src( $parent->image_id )[0];
+ $colour = get_term_meta( $parent->term_id, 'color', true );
+ $colour = ( '' !== $colour ) ? $colour : 'transparent';
+ ?>
+ - term_id, 'company' )->name ); ?>
+
@@ -185,13 +203,31 @@
image_id, 'detail' )[0];
- $colour = get_term_meta( $child->term_id, 'color', true );
- $colour = ( '' !== $colour ) ? $colour : 'transparent';
- ?>
+ // Filter out children with only private roles associated.
+ $child_args = array(
+ 'posts_per_page' => - 1,
+ 'post_type' => 'job',
+ 'tax_query' => array(
+ array(
+ 'taxonomy' => 'company',
+ 'field' => 'slug',
+ 'terms' => get_term( $child->term_id, 'company' )->slug,
+ 'include_children' => 1,
+ ),
+ ),
+ );
+ $child_jobs = new WP_Query( $child_args );
- - term_id, 'company' )->name ); ?>
-
+ if ( $child_jobs->have_posts() ) :
+ $img_url = wp_get_attachment_image_src( $child->image_id, 'detail' )[0];
+ $colour = get_term_meta( $child->term_id, 'color', true );
+ $colour = ( '' !== $colour ) ? $colour : 'transparent';
+ ?>
+ - term_id, 'company' )->name ); ?>
+
No children.