Hi!
Occasionally it can happen in the wake of a stronger UTI that there is an overgrowth of bacteria that are normally kept in check by a fully working immune system. However this needs a vet check and test.
As to diet recommendations, please keep the diet as green and leafy as possible and ideally as close as you can to the grass/hay diet (rich in vitamin C by the way which is why piggies have never had the need to make their own), supplemented with someother foraged plants for trace elements etc. A little fruit is a rare and special find.
Please stay off fruit, root veg and grains (including sweetcorn) any more than a very occasional special treat - carrots are like feeding chocolate for a guinea pigs. You mean well, but unfortunately meaning too well can in effect shorten a healthy life span and prolong it. Guinea pigs are not humans, so don't try to be influenced by human preferences and human 'rainbow veg' diet recommendations.
In my own experience, echoed by other long term forum members, restricting the diet has meant that more of my piggies (even adoptees from bad backgrounds) are living to the upper end or beyond the average life span instead to the lower end.
You will find that your digestive issue will hopefully gradually disappear as in a diet less high in sugar, you have less of an issue with dysbiosis, i.e. overgrowth of the wrong kind of bacteria, which can promote and contribute to diarrhea and bloating problems. it also strengthens the immune system, so your piggies are better at fending off/controlling opportunistic bugs like UTI, UTI, parasites etc.
If you want to treat your piggies, opt for speciality hays, dry forage as a special treat (not too much to often); but above all, turn feeding time into enrichment time and make it fun but letting your piggies work for their food and employ their brain and their senses.
It is however not a quick fix and will take several weeks to come through.
Long Term Balanced General And Special Needs Guinea Pig Diets
Enrichment Ideas for Guinea Pigs
PS: If you are dealing with severe or persistent/regularly recurring mild diarrhea, please see vet. With severe fluid diarrhea and your piggy poorly, do so as soon as possible.