Skip to content

Instantly share code, notes, and snippets.

@braddalton
Created June 11, 2021 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save braddalton/516842e654d4b18f898f77479350a338 to your computer and use it in GitHub Desktop.
Save braddalton/516842e654d4b18f898f77479350a338 to your computer and use it in GitHub Desktop.
Only Show 1st Category in Post Meta https://wpsites.net/?p=103338
add_filter('the_category_list', 'only_show_first_category');
function only_show_first_category( $cats ) {
return [$cats[0]];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment