Two coordination polymers based on 1,4-bis(benzimidazo-1-ly)benzene (L) and O-donor linking co-ligands, namely {[ZnL(mipa)(H2O)]}n (1) and {[Cd2L2(sdba)Cl2]}n (2) (H2mipa = 5-methylisophthalic acid, H2sdba = 4,4′-sulfonyldibenzoic acid), have been synthesized under solvothermal conditions and structurally characterized by X-ray single-crystal diffraction. Compound 1 has a 1D chain structure, forming 2D layers by hydrogen bonds. Adjacent layers stack over each other in an ABCD manner along the c-axis to further pack into a 3D supramolecular structure supported by π–π interactions. Compound 2 possesses an intriguing 3D architecture, which is constructed from dinuclear [Cd2L4Cl2] secondary building units and V-shaped sdba2− linkers. Both compounds show strong photoluminescence at room temperature with peaks at 362 and 356 nm, respectively, assigned to intraligand and/or ligand-to-ligand charge transfer transitions. Compound 2 can be used as a highly selective probe for Hg2+ detection in aqueous solution based on luminescence quenching. The activity of compound 2 as a photocatalyst for the degradation of methylene blue under UV irradiation has been explored.