We study the dynamics of a SIR epidemic model with nonlinear incidence rate, vertical transmission vaccination for the newborns and the capacity of treatment, that takes into account the limitedness of the medical resources and the efficiency of the supply of available medical resources. Under some conditions we prove the existence of backward bifurcation, the stability and the direction of Hopf bifurcation. We also explore how the mechanism of backward bifurcation affects the control of the infectious disease. Numerical simulations are presented to illustrate the theoretical findings.