Is it OK to wear khakis to a funeral?

What should you not wear to a wake?

What do you wear to a wake and funeral?