At the Dirac-like point at the Brillouin zone center, the photonic crystals (PhCs) can mimic a zero-index medium. In the band structure, an additional flat band of longitudinal mode will intersect the Dirac cone. This longitudinal mode can be excited in PhCs with finite sizes at the Dirac-like point. By introducing positional shift in the PhCs, we study the dependence of the longitudinal mode on the disorder. At the Dirac-like point, the transmission peak induced by the longitudinal mode decreases as the random degree increases. However, at a frequency slightly above the Dirac-like point, in which the longitudinal mode is absent, the transmission is insensitive to the disorder because the effective index is still near zero and the effective wavelength in the PhC is very large.