A few things worth pointing out here.
First off, during and just after WWI the symptoms that soldiers were experiencing were labelled "shell shock". Later in the 20th century as psychology and psychiatry advanced and as mental illness became less stigmatized what was known as shell shock began to be recognized as substantially an expression of PTSD. And people have after the fact labelled WWI "shell shock" as PTSD.
However, that's an incomplete story. More recently medical science has discovered the existence of many forms of sub-acute traumatic brain injuries (TBI), including those caused by surviving nearby explosions. Some of the symptoms of blast TBI are: fatigue, speech problems, sleep disruption, blurred vision, photosensitivity, memory and concentration problems, depression, anxiety, irritability, mood variability, among others. Some of these symptoms can be debilitating, some of them also overlap with PTSD.
Almost certainly, many WWI vets suffered from a combination of both PTSD as well as blast TBI which at the time was simply called "shell shock".
Another major factor is that WWI was the first mass industrialized war on such a scale, it broke many of the norms that had been in existence previously. And this exposed many weaknesses in the official policies of armed forces, especially in regards to keeping soldiers on the front lines for extended periods of time. During the early years of WWI many soldiers spent an extremely long time in the worst conditions on the front lines. Subject to regular shelling and sniper attacks, always on alert for an enemy attack whether it be overt or covert. Existing in miserable living conditions, subjected to the smell of mud, latrines, and the dead and decaying bodies in no man's land. Days, then weeks, then months, then seasons, then years. This is the recipe for PTSD. To establish a condition of intolerable existence, hopelessness, and constant fear. Since then modern militaries have introduced a large number of changes such as regular troop rotations, better hot food at the front lines, better medical care, etc. These practices have likely reduced the severity and incidence of PTSD but have definitely not gotten rid of it (far from it).
"Premodern PTSD" is quite literally the most frequently asked question on this subreddit. You may want to start here under "Soldiers and Fighting." cc /u/Rowanrobot