They are probably attracted to the wort like you said, I have a huge problem with them when I brew in my garage. If you dont have pets in your yard they are probably coming from someone elses place/yard/garbage. Any farm land near by? If you have pets in your yard clean up the waste, you can also go organic and buy these little creatures called fly preadators. They are living insects that eat fly larva. They come looking like dried up maggots and you sprinkle them in the problem areas of your yard. A couple applications of them should be plenty to get them established.
Other than traps, posion and cleanliness nothing you can really do about them other than keep them out of your finished wort.
Oh by the way those flies with blue/green bodies are not common house flies, those are blow flies, usually seen on dead bodies, **** or very rancid garbage with rotting food in it.