Earth and ferromagnetism
Actually, the core has two parts. The outer core is liquid, while the inner core is solid.

As explained in the Wikipedia article about Earth's magnetic field:


  The Earth's magnetic field is mostly caused by electric currents in the liquid outer core, which is composed of highly conductive molten iron.