title: Wordpress - get categories only from current post
body: <p>I want to display the categories on single.php <strong>only from the current post</strong>. I'm using this code, but it displays all categories in use... What should I do? </p>
  
  <pre><code>&lt;nav class="post-navigation"&gt;
  &lt;?php $args = array(
       "hide_empty" =&gt; 1,
       "type"      =&gt; "post",      
       "orderby"   =&gt; "name",
       "order"     =&gt; "ASC" );
       $categories = get_categories( $args );
      foreach ( $categories as $category ) {
          echo ' &lt;a href="' . get_category_link( $category-&gt;term_id ) . '"&gt;' . $category-&gt;name . '&lt;/a&gt;';}
  ?&gt;
  &lt;/nav&gt;
  </code></pre>