Warning when author has no post

Try wrapping the rsort bit in an if statement like this:

if (!empty($post_dates)) {
    rsort($post_dates);
} else { echo 'optional error message here'; }

This will check to see if the variable is empty first, and only run rsort() if it is not empty. This check works most of the time, but a false positive can sometimes occur if, for example, the variable is not actually an array but contains other data! (such as an error message). Alternatively, you may find this to work better in certain circumstances:

if ($post_dates != '') {
    rsort($post_dates);
}

This will only continue if the variable does not equal null, which isn’t quite the same thing as being empty. There are other ways to check if the variable is what you want, for example if (is_array($post_dates)) { do stuff }.

tech