I was, of course, secretly hoping he might offer some clever advice. And he did. I think maybe he will forgive me for repeating his advice on here, verbatim. For the benefit of all of us struggling PhD students.
What I've learned about bad days is that they can often be rescued: I tell myself I'll give up until the tension lessens, then pop in an hour or two later in the day and it always goes much better. The reason, I think, is the lessening of tension combined with what I think Jerome K. Jerome called roving (this is a very distant memory): the sub-conscious brain works on problems far more efficiently than the punishing superego and it keeps going (roves) even when one has officially clocked off. Thus, when one returns to the problem, it gets resolved much more speedily. Rather than clock off completely, one can also turn to mechanical tasks: footnotes, formatting, bibliography, etc. and the roving still takes place, I find.
(And then later he said:)
Try and enjoy yourself also: you've achieved an awful lot already and should celebrate that as you go!