The Sun produces a wide range of radiation, from long radio to visible to X ray to Gamma Ray, and that includes infrared. This range of types is called the electromagnetic spectrum. There is a very good description of the EM spectrum here:
https://imagine.gsfc.nasa...ox/emspectrum1.html. The infrared radiation that comes from the Sun has no effect on Earth's magnetic field.