Abstract Environmental heterogeneity is one of the most fundamental drivers of species diversity. For decades, ecologists have suggested that heterogeneity–diversity relationships are generally positive. But today, a greater variety of heterogeneity–diversity relationships is discussed. In this study, we contrasted two hypotheses for wood‐inhabiting fungi: The classical heterogeneity–diversity hypothesis, which predicts positive relationships due to an increase in niche dimensionality with increasing heterogeneity. And the more recently stated area‐heterogeneity trade‐off hypothesis, that predicts a unimodal pattern due to an inherent trade‐off between the number of occupied niches and the effective area per species. It allows positive and negative relationships only as special cases. We sampled 3715 deadwood objects on 135 plots along a forest structure gradient in the Black Forest, Germany, and recorded 284 wood‐inhabiting fungal species. To assess heterogeneity of deadwood structures, we calculated two multidimensional structural diversity indices: Structural richness was used as a measure of available niche space, and structural divergence as a measure of multivariate variance within that niche space. Those indices were then related to species richness estimates for rare, common and dominant species using the framework of Hill numbers. We found a linear, positive effect of structural richness and a unimodal effect for structural divergence on estimated species diversity. Structural richness, but not structural divergence, was strongly correlated with the number of sampled deadwood objects. No clear differences between the responses of rare, common and dominant species to the two heterogeneity gradients were found. We also estimated the mean abundance as a proxy for mean population size, which decreased significantly with structural richness but was non‐significantly related to structural divergence. Synthesis. In general, the results of this study suggest a unimodal heterogeneity–diversity relationship for deadwood‐inhabiting fungi and are thereby in line with the area‐heterogeneity trade‐off hypothesis. Thus, the negative effect of heterogeneity should lead to lower species richness and a higher risk of stochastic extinctions at high levels of heterogeneity. However, as deadwood amount and deadwood diversity are often strongly correlated, we argue that the positive effect of resource availability on species richness may mask the negative effect of structural heterogeneity in some cases.