In Rick's guidebook on Istanbul he writes that Hagia Sophia is open all day except for during prayer times. However, I find no other information source that says the same. Please advise, as I would definitely make an odd-hour visit rather than brave the crowds of midday.
If Hagia Sophia is open for regular hours, please advise about the best time to avoid crowds.