title: how to get parent category id in wordpress
body: <p>how to get only parent category ids. not children category ids
  i tried this code before which is showing me all ids of categories</p>
  
  <pre><code> &lt;?php  $category_ids = get_all_category_ids();
  
   foreach($category_ids as $cat_id) {
    $cat_name = get_cat_name($cat_id);
    //echo '&lt;span class="png_bg category_icon"&gt;&lt;/span&gt;' . $cat_name ;
  ?&gt;
              &lt;option&gt;&lt;?php echo '&lt;span class="png_bg category_icon"&gt;&lt;/span&gt;' . $cat_name ; ?&gt;&lt;/option&gt;
     &lt;?php
   }
     ?&gt;          
              &lt;/select&gt;
  </code></pre>