Had this problem for a while. Delta, single handle, shower. Sometimes showers are hot. Sometimes luke warm to cool. To fix the luke warm shower we have found that turning the hot side of the sink (same bathroom) on causes the shower to get steamy hot (good). It doesn't take a lot of sink flow, just a little does the trick. Turn the sink off and we go back to luke warm shower water.
To make the mystery even more interesting is that the hot water side of the sink comes out cold while the shower is on. Both faucets (sink and shower) are fed from the same hot water line. How is cold water being introduced to the hot side of the sink.
Changed out the shower cartridge, as well as the sink cartridges within the last six months. This did not fix the problem.