A Griffiths' theorem for varieties with isolated singularities