Mughira bin Shuba reported,

The rider travels behind the funeral procession, while the walker may walk behind it, in front of it, to its right, or to its left, staying close. The funeral prayer is performed over a stillborn child, and supplication is made for its parents, asking for well-being and mercy.Yunus said, "The people of Ziyad attribute this to the Prophet ﷺ, but I myself do not remember it as such."

Ahmad 18181

Sahih

حدثنا إسماعيل أخبرنا يونس عن زياد بن جبير عن أبيه أن

المغيرة بن شعبة قال

الراكب يسير خلف الجنازة والماشي يمشي خلفها وأمامها ويمينها وشمالها قريبا والسقط يصلى عليه يدعى لوالديه بالعافية والرحمة قال يونس وأهل زياد يذكرون النبي ﷺ وأما أنا فلا أحفظه

أحمد 18181صحيح
Contents
Reference
Commentary
Ayat
Collection
Musnad Ahmad
Book
Mughira bin Shuba
Numbering
Darussalam 18181
Ahmad 18181