Carbon nanospheres are successfully synthesized with a particle size of about 140 nm using a two‐step hydrothermal method and used the carbon nanospheres as the deposition template material on the surface of P25(TiO2) by means of vertical deposition method. The antiopaline TiO2 photonic crystal (PC) structure is further prepared via immersed carbon nanospheres in TiO2 precursor solution, and the antiopal PC is used as the scattering layer of the photoanode of dye‐sensitized solar cell (DSSCs). As a comparison, the antiopal PC reflective layer is also prepared on the photoanode of DSSCs using polystyrene nanospheres as the template material. The photoanodes with those PC scattering layers prepared with different template materials are fabricated into complete DSSCs. The final photoelectric conversion efficiency of the DSSCs prepared with carbon nanospheres as the template material reaches 7.02%, which is comparable to the cells prepared with polystyrene nanospheres as the template material. The efficiency of the cell with the scattering layer is increased by about 16% compared with that of the normal DSSC based on P25.