Sort posts properly