Exclude Child Category Links From Entry Meta

This code enables you to exclude or include all/specific child/sub categories from the entry meta in the entry footer of Genesis child themes.

By default, Genesis uses a shortcode named post_categories to display both parent and child category links in the entry footer. This shortcode uses the WordPress function get_the_category_list to display comma separated category links inline like this :

Once you add the code from this tutorial, child category links are removed like this :

Note : This code will work in any WordPress theme.

Here’s the demo video showing how it works :

Demo Video

Shows how the code removes all child categories assigned to a post.

Based on this question from a member of the Genesis community :

Does anyone know how to only show parent categories in the post meta rather than the parent and all the children?

Code Installation

There’s only 1 step :

From the download folder, copy & paste the PHP code from the functions.php file to the end of your child themes functions.php file.

Register or Login to access the download folder :

Related Tutorials

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.