Damien Menzies appeared at the High Court in Livingston charged with taking hold of the boy and repeatedly shaking him.
It is alleged that the child suffered severe injury and permanent impairment as a result of the alleged assault.
The 25-year-old, who lives in Kent, denied putting the baby's life in danger at Deans Community High School in Livingston on 10 October 2014.
He also denies breaching bail by attempting to contact the child's mother in December 2014.
The court heard that the child was taken from the school to St John's Hospital in Livingston before he was transferred to the Royal Sick Children's Hospital in Edinburgh for treatment.
The trial before Lady Scott continues.
A man has gone on trial charged with attempting to murder a 26-day-old baby.