I have a headache from a cold.

Literal

Cold [cause-で] head [subject-が] hurts.

頭が痛い is the standard expression for 'I have a headache,' with で marking the cold as the cause. 頭 here covers the head broadly, not just the skull.