Is it possible to have a page which shows a list of the custom tax parents only and only 1 post per custom tax, i/e link to the parent archive
So even though the custom tax may have x number of posts and x number of child custom tax's its basically just showing a link to that custom tax archive page parent.
SO essentially an archive page just for the custom tax parents ignoring the posts within.
I can do this manually with a page template and query each custom tax individually but wondered if it could be done dynamically.
I have the following but its spitting out all the posts within the category. Perhaps get_terms is needed i'm not sure?
<?php
$args = array(
'posts_per_page' => -1,
'post_type' => 'product',
'tax_query' => array(
array(
'taxonomy' => 'product-area',
'field' => 'slug',
'terms' => array('insulation','drylining-plastering'),
'include_children' => false
)
)
);
$products_tax = new WP_Query( $args );
if($products_tax->have_posts()) :
while($products_tax->have_posts()) :
$products_tax->the_post();
?>
<h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<?php the_title(); ?>
</a></h2>
<?php
endwhile;
else:
?>
Oops, there are no posts.
<?php
endif;
wp_reset_postdata();
?>