Joe; I doubt you have "water hammer" WH subsides within a few moments of a sudden valve closure. Based on your description of "... bang & knock for a few annoying hours.." that it is caused by thermal expansion (contraction) as the water in the pip
es cool. You don't hear it initially, as the sound of the shower masks it. Insulating the pipes will slow the heat loss & slow the thermal contraction. Oddly, this can also be caused by excess pipe hangers.