title: WordPress > Get custom taxonomy from a custom post type
body: <ol>
  <li><a href="https://en-gb.wordpress.org/plugins/custom-post-type-ui/" rel="nofollow noreferrer">Installed Custom Post Type UI wordpress plugin</a></li>
  <li>Created a custom post type  = 'products'</li>
  <li>Registered a custom taxonomy categories (different from category) using </li>
  </ol>
  
  <p><strong>1. How to display all custom post types and have a filter above with categories that works as filter tabs?</strong></p>
  
  <p><strong>2.How to loop in a custom template through the custom taxonomy 'categories' and display links?</strong></p>
  
  <p><strong>HTML structure</strong></p>
  
  <p>Custom Post type URL : 
  /wp-admin/edit-tags.php?taxonomy=categories&amp;post_type=products</p>
  
  <p><strong>PHP</strong></p>
  
  <pre><code>&lt;?php get_term( $term, $taxonomy, $output, $filter ) ?&gt;
  
  &lt;?php 
  $args=array(
    'name' =&gt; 'categories'
  );
  $output = 'products'; // or names
  $taxonomies=get_taxonomies($args,$output); 
  if  ($taxonomies) {
    foreach ($taxonomies  as $taxonomy ) {
      echo '&lt;p&gt;' . $taxonomy-&gt;name . '&lt;/p&gt;';
    }
  }  
  ?&gt;
  
  &lt;?php 
  $args = array(
    'public'   =&gt; true,
    '_builtin' =&gt; false
  
  ); 
  $output = 'names'; // or objects
  $operator = 'and'; // 'and' or 'or'
  $taxonomies = get_taxonomies( $args, $output, $operator ); 
  if ( $taxonomies ) {
    foreach ( $taxonomies  as $taxonomy ) {
      echo '&lt;p&gt;' . $taxonomy . '&lt;/p&gt;';
    }
  }
  </code></pre>