How to Display Only Parent Category in your WordPress Post Loop

Interactive Online > Blog  > CMS  > WordPress  > How to Display Only Parent Category in your WordPress Post Loop

How to Display Only Parent Category in your WordPress Post Loop

When you use the_category() template function in your WordPress theme, it displays both the parent category and any child/subcategories under it. If you are creating a site that uses a lot of child categories to categorize the content, then this can become a problem because the_category code will create a lot of clutter. In this article, we will show you how to display only parent category in your WordPress post loop.

How to Display Only Parent Category in your WordPress Post Loop is a post from: WPBeginner which is not allowed to be copied on other sites.

Related posts:

  1. Display Subcategories on Category Pages in WordPress
  2. How to Exclude Latest Post from the WordPress Post Loop
  3. How to Display Any Number of Posts in a WordPress Loop

(read full article on source site)
Free Website for Your Dental Practice
See why our dental practice websites exceed the features & value of your typcial dentist website.
  • No cookie-cutter websites
  • No duplicate content
  • Custom built with a unique look and feel
  • Unique content written by professional writers
  • Set yourself apart from other dentists
  • The key to your online success!
* we never share your e-mail with third parties.