In the greenhouse of the Chinese Academy of Sciences located on Huaizhong Road in Shijiazhuang City, Hebei Province, five fertilization treatment levels were established. These consisted of no fertilization (CK), conventional chemical fertilizer (with 100% chemical fertilizer application), and biogas slurry substitution treatments for chemical fertilizers (replacing 30%, 60%, and 100% of the chemical fertilizer nitrogen with biogas slurry nitrogen). Soil nutrient determination methods and high-throughput sequencing were employed to elucidate the correlative relationship between soil nutrients and microbial community metabolism. The results showed that in contrast to the treatment of solely applying chemical fertilizers, the combined application of biogas slurry could effectively enhance the soil nutrient content during different growth stages and promote the growth of corn plants. Among them, the replacement of 30% of the chemical fertilizer with biogas slurry exhibited the most optimal effect on augmenting soil nutrients and plant nutrient absorption. After the combined application of biogas slurry, the richness of both bacterial and fungal communities was substantially increased, and the diversity of the bacterial flora was also notably enhanced. However, the application of only biogas slurry led to a reduction in the species diversity of soil fungi. Pearson correlation analysis indicated that the Chao1 index of bacterial and fungal communities was significantly positively correlated with soil available phosphorus, available potassium, and nitrogen in the form of nitrate and significantly negatively correlated with pH. In summary, the combined application of chemical fertilizer and 30% biogas slurry was most conducive to enhancing the metabolic activity of soil microorganisms and the functional diversity of soil microbial communities, and when a relatively large amount of biogas slurry was used, it could completely substitute the chemical fertilizer.