Can anyone help me adapt the below which creates a set of <LI>
elements with custom taxonomy categories created in a custom post type I have. What I want to achieve is to only list the 'project-type' results which match a defined value.
So, I only want the <LI>
to be listed if the 'project-type' value includes 'sector1' in the its name.
So, the 'project-type' names could be "sector1-subsector1", "sector1-subsector2", "sector2-subsector1" - from these only 2 would be listed as an <LI>
- e.g. where the start of the name includes "sector1".
<?php
$terms = get_terms('project-type');
foreach ($terms as $term) { ?>
<li data-filter=".<?php echo $term->slug; ?>"><?php echo $term->name; ?></li>
<?php } ?>