Forum
Display only parent category for blog post / hide sub-categories
I'd like to display only the parent category (via post_in_list.html) for each post on my main blog index page. I still want to apply sub-categories and have them available within the actual posts and for archiving purposes.
This is what I have now and it displays both parent and sub-categories on my blog index page:
<perch:categories id="categories" set="blog"> <a href="archive.php?cat=<perch:category id="catSlug" type="slug" />" class="p-category"> <perch:category id="catTitle" type="text" /> </a> </perch:categories>
Any help would be greatly appreciated! Thank you!
You could test for
catParentID
being0
:Perfect! Thank you Drew!!