You need to shoot with a smaller aperture (larger f-stop number). A wide-open aperture lets in a lot of light, but also gives you a very shallow depth-of-field. Stopping the aperture down will let you keep more of the scene in focus. You also might want to consider shooting at a wider angle, as DOF becomes more pronounced the more zoomed-in you are.
I also highly recommend learning the basics of photography, as this explains the effects of aperture and all the other settings that go into creating an exposure.