title: Display Wordpress parent Category with their child category
body: <p>I want to display only those the parent category which have some child category with their child category without using <code>child_of=</code></p>
  
  <p>I was trying to display but i am only able to get the list of child category not their parent category name.</p>
  
  <pre><code>&lt;?php
  
  $querystr = "SELECT wp_terms.name, wp_terms.term_id, wp_terms.name FROM wp_terms, wp_term_taxonomy WHERE wp_terms.term_id = wp_term_taxonomy.term_id AND wp_term_taxonomy.parent !=0 ";
  $cat_child = $wpdb-&gt;get_results($querystr, OBJECT);
  var_dump($cat_child);
  foreach ($cat_child as $category) {
           echo $category-&gt;name. ' , ';
        }
    ?&gt;
  </code></pre>
  
  <p>Help me..
  Thanks </p>