Solid ionic compounds do not conduct electricity because the ions (charged particles) are locked into a rigid lattice or array. The ions cannot move out of the lattice, so the solid cannot conduct electricity.
When molten, the ions are free to move out of the lattice structure.
When an ionic solid is dissolved in water to form an aqueous solution, the ions are released from the lattice structure and are free to move so the solution conducts electricity just like the molten (liquid) ionic compound.