We consider a two-component gas of fermions in optical lattices in the presence of a population imbalance within a mean-field theory. We study phase transitions from a normal gas of unpaired fermions to a superfluid phase of Bose-condensed Cooper pairs. The possibility of Cooper pairs with a nonzero centre-of-mass momentum is included, which corresponds to a so-called Fulde–Ferrel–Larkin–Ovchinnikov (FFLO) state. We find that for population-imbalanced systems such states can form the ground state. The FF and LO state are compared and it is shown that actually the LO state is energetically more favourable. We complete the mean-field phase diagram for the LO phase and show that it is qualitatively in excellent agreement with recent diagrammatic Monte Carlo calculations. Subsequently, we calculate the atomic density modulations in the LO phase.