"Wider" is quite old-fashioned. You will hardly find it in modern texts or conversations, except a few fixed expressions like "wider den tierischen Ernst" or as a part of verbs like "widersprechen", "widerlegen" etc.
For your active vocabulary, it will be enough to use "gegen".