It is also permissible not to pray the funeral prayer for a minor child
◈ عن عائشة قالت: مات إبراهيم بن النبى وهو ابن ثمانية عشر شهرا فلم يصل عليه رسول الله صلی اللہ علیہ وسلم
“Aisha (may Allah be pleased with her) narrates that the son of the Messenger of Allah ﷺ, Ibrahim, died at the age of eighteen months. He did not pray the funeral prayer for him.”
Reference: Hasan, Sunan Abi Dawud, Kitab al-Janaiz, Bab fi al-Salah ala al-Tifl: 3187
Benefit: That is, if one prays the funeral prayer for a minor child it is better, and if one does not pray it, it is permissible.
Note: In Abu Dawud
Reference: Volume 2, p. 98, hadith number 3188
two narrations have come in which it is mentioned that he prayed the funeral prayer for Ibrahim. This narration is da’if (weak) and munkar (rejected).