I took some white posterboard, cut a circle that would overhang the container 1-2", cut a slot to the center (so it would slip past the stalk of the plant). I made two of those to overlap the slots. That reduced my gnats.
I've heard some people put panty hose on the hose on the bottom of their containers to keep the gnats out of the drain holes. EcoSmart makes a "organic insect killer" made of rosemary, thyme, peppermint and clove oil. I spritz that around the base of the container after each feeding. That repels them. It's an irritant to them. (Also to the plant. I wouldn't spray leaves, nor a seedling container.).