Fix invalid foreach error

`get_the_terms()` can also return false, so this ensures that our method returns an empty array when there are no terms from an associated taxonomy applied to the single post entry.

Hat tip to @devinsays for reporting the error.