Automattic / _s

Hi. I'm a starter theme called _s, or underscores, if you like. I'm a theme meant for hacking so don't use me as a Parent Theme. Instead try turning me into the next, most awesome, WordPress theme out there. That's what I'm here for.
http://underscores.me/
GNU General Public License v2.0
10.93k stars 3.12k forks source link

Improved the category output on posts #1460

Open ndiego opened 3 years ago

ndiego commented 3 years ago

When a post has no category assigned to it, not even the default Uncategorized category that WordPress assigns, the _s_entry_footer() function still outputs "Posted on Uncategorized". This PR fixes that.

It appears as if this function was intended to display nothing when a post has no categories since it is checking if $categories_list exists. The problem is this variable is set to "Uncategorized" by default if the post has no categories assigned. In this PR, we are simply adding the has_category() check to the conditional. Then, when a post has no categories, nothing is displayed as expected!