I would say that what you had was fine. I don't know why your simplification didn't work. Could it be that you can't have whitespace (newlines and spaces) inside quotes? Maybe if you included the quotes in each condition instead of once around all of it, it would work.
As for in_array() vs the AND, with two options I'd say it doesn't matter which way you do it. But these are just my opinions, I don't know that I'd call myself an authority on style.
If you wanted to simplify the template code you could use a plugin to set the avatar image, then register a variable to the template. But I suppose one could argue that that actually makes things more complicated.
|