This code once added to your child themes functions file enables you to remove one or more categories from the post_categories shortcode output in the entry footer on single posts and archive pages.
All you need to do is add a comma separated list of category ID’s to the code.
Only Show 1st Category
You can then use this code snippet to show the 1st category only
add_filter('the_category_list', 'only_show_first_category');
function only_show_first_category( $cats ) {
return [$cats[0]];
}
Leave a Reply