The linear birefringence effect of the uniaxial anisotropic materials is utilized to design an optical polarizer in this paper. We propose a one-dimensional photonic crystal structure with an anisotropic defect layer to break the degeneracy of the TE and TM mode resonances. The band structures of the TE and TM mode polarizations are calculated using the plane wave expansion method, which has been generalized for the structures containing anisotropic materials. By increasing the refractive index contrast ratio of the HL pair layers of the crystal, we present an ultracompact structure with significant performance of a very high polarization extinction ratio (PER) and a very low insertion loss (IL). The presented polarizer, which operates at the near-infrared region centered at the wavelength of 1550 nm, is 2.67 μm long. It is obvious that the structure is considerably compact for the long wavelength of the third communication window. The polarizer can be designed in such a way that only the fields with a specific polarization direction (TM, TE, or any other direction) are transmitted.