Hello GP Team!
I’ve created some CPTs for example ‘reports’, ‘consultations’ , ‘briefings’ ,
I’d like these to show up in the right side bar of the archive pages (which I can do via ‘Elements’ > ‘Layout’
But, I need the CPT categories to show up first. Can only see native cats from posts.
I’m not sure how to get them to show up:
<?php $categories = get_terms( ['taxonomy' => 'reports'] ); ?>
<ul>
<?php foreach($categories as $key => $category) { ?>
<li>
<a href="<?php echo esc_url( get_term_link($category) ); ?>">
<?php echo esc_html($category->name); ?>
</a>
</li>
<?php } ?>
</ul>
Thanks in advance
Ema