Anyways, I've always been told that it's not safe to feed and then ride. I'm not sure if there's truth to that or if it's just a thing that folks say, but... IS it a thing? How long should you wait to ride after feeding grain? And to the opposite, how long should you wait to feed after riding?
Yes, if you're feeding a big grain meal a horse will find that difficult to digest. But hopefully you are not feeding actual grain (corn, oats, barley) since those are not great for horses anyway, but instead are feeding a pellet which people call "grain," even though it is something like hay pellets, beet pulp, or other roughage. Horses digest these like hay, so there is no problem with feeding them before or after riding.
If you are feeding roughage, or even a small amount of grain as in a pound or so, it is actually much better to feed a horse before riding rather than have them exercise on an empty stomach. Horses are meant to eat and exercise constantly throughout the day. They actually do not have lining on the upper part of their stomach, which means if they exercise on an empty stomach, the acid can splash up and cause ulcers. The natural state of a horse is to have food in the stomach nearly all the time, and it is natural to exercise with food in the stomach.
So many people such as myself make it a point to always feed some hay, pellets or grass before exercising a horse.
Endurance riders feed horses at every vet check along the ride, making sure they keep their digestive system working throughout the ride. This helps prevents metabolic issues and fuels the muscles for long distance. They also give horses water as often as they can, under vets advice, disproving another "old wives' tale" that you shouldn't give horses water before or after exercise .