Soil fungi are key drivers in regulating the ecosystem function, playing a vital role in protecting the plant from phytopathogens and other biotic and abiotic pressures. However, the potential impact of compost addition and soil aggregate size on the fungal community and functional ecological guild remains uncertain. This study investigated the structure, composition, and function of soil fungal communities across aggregate fractions under food waste compost addition using Miseq sequencing and FUNGuild. Compost addition exerted a negative impact on fungal α-diversity, and shifted the structure and changed the composition of fungal community. Compost addition rates exhibited more contributions to fungal α-diversity variations (R = 0.609, 0.895, and 0.501 for Sobs, Shannon, and Chao indices, respectively, P = 0.001) and the separation of community structure than soil aggregate size (R = 0.952, P = 0.001). Biomarkers, including Chaetomiaceae, Ascobolaceae, and Sordariomycete, displayed significant superiority in compost-added soils, whereas the populations of Nectriaceae and Clavicipitaceae were significantly decreased. The relative abundances of animal and plant pathogens were significantly decreased, whereas that of saprotrophs were increased. The abundances of pathogens correlated positively with pH and negatively with nutrients (soil organic matter, dissolved organic carbon, total nitrigen, NH4+, and NO3−), whereas those of saprotrophs showed an opposite trend. The dose of compost was the major driver for fungal functional guild variation, whereas carbon and nitrogen source exhibited more contributions to function variation than pH value. These results provide a reference for sustainable ecological agriculture by applying compost rationally under the conditions of soil health and agricultural performance.