WordPress exclude categories from the_category

This is an update to an excellent old post on wordpress.com that partially explains how to exclude categories from the_category() function in WordPress. ocshawn’s solution half way down the page worked with a few small adjustments. Add the following to your WP functions.php (ideally in a child theme): function exclude_post_categories($excl=”){ $categories = get_the_category($post->ID); if(!empty($categories)){ $exclude=$excl; $exclude = explode(“,”, $exclude); $html = … Read More