The main aim of this work is to give a theoretical interpretation for the "anomalous" liquid-structure factors of zinc and cadmium near freezing and for their variation with temperature, as contrasted with the "normal" behavior of a liquid metal such as potassium. Using an ab initio generalized nonlocal model pseudopotential and with two alternative exchange-correlation functions for electronic screening, we construct interionic pair potentials for the above metals. These are then used for liquid-structure calculations within two alternative integral-equation schemes of considerable refinement, namely the modified hypernetted-chain approach of Rosenfeld and Ashcroft [Phys. Rev. A 20, 1208 (1979)] and the hybridization of the hypernetted chain and the soft-core mean spherical approximations as proposed by Zerah and Hansen [J. Chem. Phys. 84, 2336 (1986)]. The comparison between the theoretical results for the temperature dependence of the liquid-structure factor of potassium and very recent neutron-diffraction data gives us confidence in the high reliability of the pseudopotential in the present integral-equation schemes. The same approach is then extended to investigate the liquid-structure factors for zinc and cadmium near their freezing temperature and at a few temperatures above freezing. We find that the asymmetric shape of the main peak in the structure factor of these elements near freezing can be understood in terms of the role of the medium- and long-range interaction parts in the pair potential. Our results also shed some light on the subtle changes of the liquid structure of these divalent metals with temperature, and specifically on the thermal influence in restoring the skewed shape of the main peak back to a normal symmetric shape at much higher temperatures.