title: wordpress get category name of custom post type in wordpress loop?
body: <p>I want to get the category name of custom post type in query posts loop.</p>
  
  <p>here is my code:</p>
  
  <pre><code>query_posts(array('post_type'=&gt;'portfolio','posts_per_page'=&gt;4, 'orderby' =&gt; 'ID', 'order' =&gt; 'DESC' ));
  
  while ( have_posts() ) : the_post();
  
  &lt;li&gt;
      &lt;div class="foli_img"&gt; &lt;a href="&lt;?php echo get_permalink();?&gt;"&gt; &lt;span class="next"&gt; &lt;/span&gt; &lt;/a&gt; &lt;?php the_post_thumbnail();?&gt; &lt;/div&gt;
      &lt;h3 class="style"&gt;&lt;?php the_title();?&gt;&lt;/h3&gt;
      &lt;?php the_content();?&gt;
      &lt;h4&gt;&lt;a  href="#"&gt;I want the category name here&lt;/a&gt;&lt;/h4&gt;
  &lt;/li&gt;
  &lt;?php endwhile;?&gt;
  </code></pre>