We demonstrate a facile yet efficient strategy to fabricate responsive photonic hydrogels by incorporating magnetic (Fe3O4) nanoparticles into the hydrogel materials. In this approach, poly(acrylamide)-poly(2-hydroxyethyl methacrylate) (PAM-PHEMA) photonic hydrogels incorporated with linearly ordered Fe3O4 nanocrystal arrays were successfully synthesized via one-step polymerization process under an external magnetic field. The resulting hydrogel materials can be endowed with pH and ion sensing functionalities by hydrolyzing PHEMA into PAA units in sodium carbonate aqueous solutions. The whole fabrication process of the photonic hydrogels would take only ∼2.5h, including dispersing Fe3O4 NPs in monomer solution for ∼10min, photo-polymerization for ∼20min, hydrolyzation of PHEMA for ∼2h. Importantly, photonic hydrogels containing fixed number of carboxyl groups can be fabricated by controlling the content of PHEMA. The photonic hydrogels demonstrate better reproducibility and keep the same pH and ionic strength sensing abilities, which is beneficial for batch preparation.