The sun's gravity also produces tides. But since the forces are smaller, as compared to the moon, the effects are greatly decreased. Tides are not caused by the direct pull of the moon's gravity. The moon is pulling upwards on the water while the earth is pulling downward.
Hope this helps :)
~Davinia.