Without a professional diagnosis from a sports doctor, the precise cause of your shin splints can not be assessed.
It should also be understood that the term shin splints is an umbrella term that covers a host of different conditions. However, many of those conditions have a common origin: poor running mechanics, and/or excessive training volume relative to our level of conditioning.
The pain and inflammation of shin splints is the consequence of repetitive strain on the muscles and fasciae as they try to counteract rapid (angular) accelerations of the ankle joint as the foot lands—that is, as they try repeatedly to stabilise the unstable foot as it lands.
Posterior pain is often the consequence of heavy landing on the foot forward of the axis of the ankle (id est, on the fore- or mid-foot). This can be due to tensing the triceps surae (calf muscles), and particularly the single-joint soleus, or having excessive tightness in those triceps surae. Poor or worn footwear can always exacerbate the problem.
Similarly, anterior pain is often the consequence of heavy landing on the heel, which thereby places excessive loads on the anterior structures, particularly the tibialis anterior.
First and foremost, it is important to allow the structures to recover fully before attempting another run. Acute inflammation can be treated with stretching (see the soleus stretch below), massage, pressure, icing or, with an appropriate medical prescription, anti-inflammatories. But there is no substitute for time.
Above: Body weight is used to push ankle of the right leg (in this image) towards the floor whilst keeping the knee forward of the toe.
Good running technique is characterised by a supple-but-responsive landing. Effort should be made to relax the muscles, and not to resist the ground excessively. The posture of the body should be erect, but with a slight forward lean such that the body ‘falls into’ the run. And forward motion of the foot should be the natural consequence of hip flexion (knee-lift) rather than knee extension. The foot should strike the ground beneath the centre of mass of the body and with a net backward velocity. This ensures that the leg is driving the body forward, rather than braking its momentum and thus absorbing shock loading.
Needless to say that this is just a general summary, which cannot even approximate the role of a good running coach or the advice of a physiotherapist or sports doctor.
Nevertheless, I hope that gives you some starting point.