The conductivity of ionic compound is due to movement or mobility of the ions that are present.
For example, the electrical conductivity of sodium chloride is because of the mobility of the ions present (Na+Cl−) . Since the ions can move only in the molten state and not in the solid state, these compounds are conduct electricity only in the molten state.