Within the framework of density functional theory, a weighted correlation approach isdeveloped in order to obtain the density distributions of an inhomogeneous fluid. It resultsin a formally exact expression, by means of the concept of a weighted pair correlationfunction, used to evaluate the change of the single-particle direct correlation function of thesystem relative to that of a reference state. When applying the approach for practical use,however, an approximation of the pair correlation function has to be made, along with anappropriate definition of a weight function. Noticeably, combining this approach withfundamental measure theory gives rise to a new method, which we call the FMT/WCA-k2 approach, for studying the structural and thermodynamic properties of a charged hard-spherefluid subjected to a spatially varying external potential. Application of the FMT/WCA-k2 approach in a range of electrolyte concentrations and surface charge densities, against theMonte Carlo simulations, shows that it is superior to the typical approaches of densityfunctional theory in predicting the ionic density profiles of both counter-ions and co-ionsnear a highly charged surface. It is capable of capturing the fine features of thestructural properties of the electric double layers, to well reproduce the layeringeffect and the charge inversion phenomenon, also in strongly coupled cases wheredivalent counter-ions are involved. In addition, it is found that the FMT/WCA-k2 approach even has an advantage over the anisotropic, hyper-netted chain approaches ingiving better agreement with the Monte Carlo results.