I disagree - humor is really useful as a communication tool. If you are naturally inclined towards humor, don't suppress it entirely. I've found it useful once in a blue moon to indirectly make the point everyone is thinking but nobody wants to acknowledge. But more generally I've found it useful to put people at ease at the start of a meeting where I need people sharing ideas and feedback.
In my experience, there are two types of humor that should be avoided, which I learned the hard way:
* Punching down (including joking about doing harm from a position of power)
* Sarcasm/cynicism in public channels, especially when it's directed at specific people/teams.