title: How do I get the parent category name in WordPress template? And can I query post by the parent category?
body: <p>I tried getting help on the WordPress forums but no luck. Anyways, here is my question...</p>
  
  <p>Lets say I am creating 10 parent categories and 2 sub categories to each parent. My WordPress post belongs to one sub category of a particular parent category</p>
  
  <p>How do I get the parent category name ONLY? I don't want subcategories names? what WordPress code would do that?</p>
  
  <p>And one more question...</p>
  
  <p>Is it possible to query post by the parent of a sub category by using:</p>
  
  
  
  <p>but instead of entering <code>cat=1</code> or the name of the particular category, can I do something like:</p>
  
  
  
  <p>So this way it would automatically insert and query post for the parent of any particular sub category that's clicked on?</p>