don't you hate that! my kids have both done it at times... though i think they were younger than your lo at the time. eventually, they did stop. in the interim, i made sure to put LOTS of diaper cream on before bed. i also tried to give more "poop-inducing" food earlier in the day - stuff like prunes or pears, in hopes that they would be cleaned out before bedtime.
but truthfully, i think their bodies eventually adjusted on their own.