Sayyiduna Mughira bin Shu’bah (may Allah be pleased with him) narrates this statement of the Prophet (peace and blessings of Allah be upon him): “The one who follows a funeral procession while riding should go behind the bier, and the one who walks on foot may walk wherever he wishes, and the funeral prayer should be offered for a (minor) child.”
Hadith Referenceصحیح ابن حبان / كتاب الجنائز وما يتعلق بها مقدما أو مؤخرا / 3049
Hadith Gradingفضيلة الشيخ الإمام محمد ناصر الدين الألبانيصحيح - «ابن ماجه» (1481 و 1507).فضيلة الشيخ العلّامة شُعيب الأرناؤوطإسناده صحيح على شرط البخاري