I have heard that photons are attracted by gravity. Does this apply to electrical or magnetic fields?
Having energy does not imply having momentum, any object in rest has potential energy and zero momentum.
Gravity does not "pull" them. Gravity bends space and the photon continues on a straight path through curved space. Photons are never accelerated, only the frequency is affected, which confirms they have no mass.
Okay so how can they have a nonzero momentum?