P-N-type heterojunctions have the potential to serve as highly efficient photocatalysts for CO2 reduction, owing to their remarkable carrier separation efficiency, high stability, and strong redox capacity. In this study, a novel P-N Co3O4/ZnO heterojunction aerogel photocatalyst was fabricated through a process starting with the propylene oxide ring-opening-induced gelation technique. The resulting Co3O4/ZnO aerogel exhibits an interconnected, hierarchical porous structure, which endows it with a particle diameter size at around several tens of nanometers and a large BET-specific surface area, thereby providing abundant exposed active sites. Under simulated solar spectral conditions, the yields of CH4 and CO can attain 18 μmol g-1 h-1 and 14.4 μmol g-1 h-1, respectively, in the absence of any sacrificial agent and photosensitizer. These values are 12.0 times and 5.8 times higher than those of the pristine Co3O4 aerogel. Based on density functional theory (DFT) calculations, the activation mechanism of CO2 on the catalyst surface is illustrated. This is confirmed by the elongated CO bond length of the CO2 molecule from 1.174 and 1.175 Å to 1.376 and 1.259 Å, respectively, after forming the Co3O4/ZnO heterojunction, which is further confirmed by the more negative CO2 adsorption energy. Further research demonstrates that the built-in electric field formed at the heterojunction interface effectively promotes the recombination of electrons in the conduction band of Co3O4 with holes in the valence band of ZnO, significantly enhancing the carrier separation efficiency and thereby boosting the photocatalytic reduction activity of CO2. This work goes beyond providing new strategies for designing efficient CO2 reduction photocatalysts, extending its impact to advancing the utilization of aerogel materials in the field of photocatalysis.