title: Taxonomy Category Permalink
body: <p>I am working on a custom post type that is using a custom taxonomy called "portfolio-category".</p>
  
  <p>Now I am trying to list the categories under this taxonomy - with the relevant permalink.</p>
  
  <p>Listing them is fine - cannot seem to find the right terms to display the permalink though (currently noted as a # on the code below).</p>
  
  <p>Here's my code:</p>
  
  <pre><code>&lt;?php
      // your taxonomy name
      $tax = 'portfolio-category';
  
      // get the terms of taxonomy
      $terms = get_terms( $tax, [
          'hide_empty' =&gt; true, // do not hide empty terms
      ]);
  
      // loop through all terms
      foreach( $terms as $term ) {
  
          // if no entries attached to the term
          if( 0 == $term-&gt;count )
          echo '&lt;li&gt;&lt;a href="#"&gt;' .$term-&gt;name. '&lt;/a&gt;&lt;/li&gt;';
  
          // if term has more than 0 entries
          elseif( $term-&gt;count &gt; 0 )
          echo '&lt;li&gt;&lt;a href="#"&gt;' .$term-&gt;name. '&lt;/a&gt;&lt;/li&gt;';
      }
  ?&gt;
  </code></pre>