Hi, many years of problems with constipation and going to have a hemorrhoidectmy soon. Trying myself to keep things moving. Here is what I do: Can't stress the water enough!!!! (and I hate water). Gatorade works for me. Hot cup of coffee or tea first thing in the morning, rolled oats of some kind, apple with skin, and dried fruits, apricots, prunes, etc. Orange or grapefruit also helps and of course nuts and seeds do wonders.
After having surgery you may just be sitting still too long. Talk a walk, even a small one, bend if you can, go around the house and pick things up, get your blood flowing--moving does wonders.
Take a fiber supplement like metamucil--not addicting--every night before bed. It helps to bulk things up but you must still eat fiber.
I am on senekot now (vegetable lax) and it has helped me.
Treating constipation is done with a mix of things not just one. Try a few and see what works for you. Good luck and hang in there!!