A new density functional theory (DFT) for an inhomogeneous 12-6 Lennard-Jones fluid is proposed based on the modified fundamental measure theory for repulsive interaction and a weighted density functional for attractive interaction. The Helmholtz free energy functional for the attractive part is constructed using the modified Benedict-Webb-Rubin equation of state with a mean-field weight function. Comparisons of the theoretical results with molecular simulation data suggest that the new DFT yields accurate bulk surface tension, density distributions, adsorption-desorption isotherms, pore pressures, and capillary phase transitions for the Lennard-Jones fluid confined in slitlike pores with different widths and solid-fluid interactions. The new DFT reproduces well the vapor-liquid critical temperatures of the confined Lennard-Jones fluid, whereas the mean-field theory always overestimates the critical temperatures. Because the new DFT is computationally as simple and efficient as the mean-field theory, it will provide a good reference for further development of a statistical-thermodynamic theory of complex fluid under both homogeneous and inhomogeneous conditions when disperse force has to be considered.