Display Custom Taxonomies under Custom post types

I’m a newbie in WordPress. I have created a custom post type called arts and custom taxonomies called male, female and children for arts. Is there a way I could list only the taxonomies under the post type arts? I have tried using get_taxonomies(); but it produces all the taxonomies but I want only taxonomies under arts. My code is here. Thanks.

<?php $taxonomies=get_taxonomies(); 

var_dump($taxonomies);

?>

Related posts

Leave a Reply

2 comments

  1. Let me know if this works for u —

    <?php 
    $args=array(
      'name' => 'arts'
    );
    $output = 'objects'; // or objects
    $taxonomies=get_taxonomies($args,$output); 
    if  ($taxonomies) {
      foreach ($taxonomies  as $taxonomy ) {
        echo '<p>' . $taxonomy->name . '</p>';
      }
    }  
    ?>
    

    ReferenceSource