Community structure exists widely in real social networks. To investigate the effect of community structure on the spreading of infectious diseases, this paper proposes a community network model that considers both the connection rate and the number of connected edges. Based on the presented community network, a new SIRS transmission model is constructed via the mean-field theory. Furthermore, the basic reproduction number of the model is calculated via the next-generation matrix method. The results reveal that the connection rate and the number of connected edges of the community nodes play crucial roles in the spreading process of infectious diseases. Specifically, it is demonstrated that the basic reproduction number of the model decreases as the community strength increases. However, the density of infected individuals within the community increases as the community strength increases. For community networks with weak strength, infectious diseases are likely not to be eradicated and eventually will become endemic. Therefore, controlling the frequency and range of intercommunity contact will be an effective initiative to curb outbreaks of infectious diseases throughout the network. Our results can provide a theoretical basis for preventing and controlling the spreading of infectious diseases.