Ecommerce Shopify WordPress Discussion

Show only taxonomy types associated with a custom post type in WordPress PHP

I am trying to display only the taxonomy types selected on a custom post type "newsroom". The code below shows all taxonomy types for every type of post. Is there a way to show only the types tagged on a post under the custom post type "newsroom"? <form action="<?php echo site_url() ?>/wp-admin/admin-ajax.php" method="POST" id="filter"> <input type="hidden" name="action" value="resource_filter"> <?php if( $terms = get_terms( array( 'taxonomy' => 'types', 'orderby' => 'name' ) ) ) { // types ?> <div class="types-filter"><h3>Types</h3> <?php foreach ( $terms as $term ){ ?> <label class="MuiFormControlLabel-root"> <span class="MuiButtonBase-root MuiIconButton-root jss317 MuiCheckbox-root MuiCheckbox-colorSecondary MuiIconButton-colorSecondary" aria-disabled="false"> <span class="MuiIconButton-label"> <input type="checkbox" name="types_filter[]" id="checkbox_types_filter_<?php echo $term->term_id; ?>" class="resource-filter-checkbox" value="<?php echo $term->term_id; ?>" data-indeterminate="false" data_term_name="<?php echo $term->name; ?>"> </span> </span> <span class="MuiTypography-root MuiFormControlLabel-label MuiTypography-body1"> <p class="MuiTypography-root MuiTypography-body2"><?php echo $term->name; ?></p> </span> </label> <?php } ?> </div> <?php } ?> </form>
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.