عَنِ الْمُغِيرَةِ بْنِ شُعْبَةَ رَضِيَ اللَّهُ عَنْهُ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ: ((الرَّاكِبُ خَلْفَ الْجَنَازَةِ وَالْمَاشِي حَيْثُ شَاءَ مِنْهَا، وَالطِّفْلُ يُصَلَّى عَلَيْهِ))
Sayyiduna Mughirah bin Shu’bah (may Allah be pleased with him) narrates that the Messenger of Allah (peace and blessings be upon him) said: The rider should follow behind the funeral, and the one on foot may walk wherever he wishes, and the funeral prayer will be offered for a child.