A theory for the description of the thermodynamic behaviour of inhomogeneous fluids is derived by the mathematical equivalent of the cluster variation method for lattice systems. A systematic expansion of the free energy functional is generated, which is then truncated and minimised to obtain integral equations for the density profile and the pair distribution function. The theory contains no adjustable parameters, the only input is the intermolecular potential and the external field (which includes wall potentials).A simplified version of this theory, valid for weakly inhomogeneous fluids, is investigated by applying it to hard-sphere and Lennard-Jones fluids between parallel plates and comparing the results with computer simulations.