It is customary for a pregnant woman not to go to a cemetery. (We are not sure of the source for this.) If the cemetery is close by and can be visited at will, it would be best to go when not pregnant. However, women may enter a cemetery while pregnant if they take care not to come within a few feet of the grave. In some cases, there is leniency for a woman to come right up to the grave, when it is important for her to do so.
There is no halachic prohibition to attend a funeral while pregnant. There is simply a custom of some not to do so so that the pregnant woman not to go to the cemetery or be in a room (ohel) with a corpse.
There is discussion about whether the pregnant wife of a kohen should be prohibited from entering a cemetery or being in a room with a corpse, since she may be pregnant with a male kohen to whom those restrictions would apply. Most halachic authorities rule leniently, and allow her to do so where that is consistent with the local custom.