It's never easy for you or the children, but if you put them first at all times (that doesn't mean spoil them rotten) then they will grow up knowing that they are loved. My ex is a nightmare, and constantly slags me off to our kids, but despite the fact that I HATE him (lol) I never moan about him to the girls, they love him as he's their dad and I respect that. If your children go to visit, make sure you still agree on discipline or you may find they play you off against each other, and never allow them to be dragged into any disputes. I know it's hard if the absent parent doesn't follow this, but just make sure you do, and they will thank you for it when they are older. It's hard work, being a single parent, but it can be rewarding. Things will get better, although my ex is still a nightmare, things are better for me, and I now have a fantastic man, who is every thing I could wish for, he is supportive when my ex is being awkward, and supports my girls, but never moans about my ex to them. Life will improve, hold on to that and you will get through this, it may not be easy, but you can be strong and make it.
Take care, and make sure you give yourself the time to heal. x