title: How to display all posts category wise of a custom post type
body: <p>I am working on a institute website which as courses.
  I want to display all posts as list category wise of a custom post type.
  for Ex.: </p>
  
  <blockquote>
    <p>CATEGORY NAME1<br/>
     - Post of category name 1<br/>
     - Post of category name 1<br/><br/>
    CATEGORY NAME2<br/>
     - Post of category name 2<br/>
     - Post of category name 2<br/></p>
  </blockquote>
  
  <p>and so on</p>
  
  <p>below is the code which is displaying all posts from custom post type from all categories but i want to show them category wise seperately please help me...</p>
  
  <pre><code>&lt;?php
  $type = 'course';
  $args=array(
    'post_type' =&gt; $type,
    'post_status' =&gt; 'publish',
    'posts_per_page' =&gt; -1,
    'caller_get_posts'=&gt; 1);
  
  
  $my_query = '';
  $my_query = new WP_Query($args);
  if( $my_query-&gt;have_posts() ) {
    while ($my_query-&gt;have_posts()) : $my_query-&gt;the_post(); ?&gt;
      &lt;p&gt;&lt;a href="&lt;?php the_permalink() ?&gt;" rel="bookmark" title="Permanent Link to &lt;?php the_title_attribute(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/p&gt;
      &lt;?php
    endwhile;
  }
  wp_reset_query();
  ?&gt;
  </code></pre>