He mentioned that the Messenger of Allah ﷺ said, "The rider goes behind the funeral procession, while the one walking may go wherever he wishes around it, and the funeral prayer is performed over the child."
أخبرنا إسمعيل بن مسعود قال حدثنا خالد قال حدثنا سعيد بن عبيد الله قال سمعت زياد بن جبير يحدث عن أبيه
أنه ذكر أن رسول الله ﷺ قال الراكب خلف الجنازة والماشي حيث شاء منها والطفل يصلى عليه