title: Get all categories of a custom post type
body: <p>I am trying to get all categories of a custom post type.I am using <code>get_the_category();</code> function to retrieve the categories.But if i have 3 posts with 1 category the category is repeated 3 times :o .</p>
  
  <h2>My codes are</h2>
  
  <pre><code>&lt;?php 
      query_posts( array( 'post_type' =&gt; 'member', 'showposts' =&gt; 8 ) );
      if ( have_posts() ) : while ( have_posts() ) : the_post();
          $categories = get_the_category();
              foreach ( $categories as $category ) { 
          echo $category-&gt;name, ' '; 
      }             
  ?&gt;
  &lt;?php endwhile; endif; wp_reset_query(); ?&gt;
  </code></pre>
  
  <p>Is there any solutions??</p>