Hadith 6:454
Sa'id ibn 'Ubayd Allah al-Thaqafi narrated to us, from Ziyad ibn Jubayr ibn Hayyah al-Thaqafi, from his father, from al-Mughirah ibn Shu'bah, from the Prophet (peace and blessings of Allah be upon him), who said: "The rider travels behind the funeral procession, and the walker [may be] wherever he wishes from it. And the child, the funeral prayer is performed over him."
حدثنا سعيد بن عبيد الله الثقفي عن زياد بن جبير بن حية الثقفي عن أبيه عن المغيرة بن شعبة عن النبي صلى الله عليه وسلم قال الراكب يسير خلف الجنازة والماشي حيث شاء منها والطفل يصلي عليه