(I think that the people of Ziyad informed me that he reported on the authority of the Prophet ﷺ: A rider should go behind the bier, and those on foot should walk behind it, in front of it, on its right and on its left keeping near it. Prayer should be offered over an abortion and forgiveness and mercy supplicated for its parents. (Using translation from Abū Dāʾūd 3180)
عَنِ النَّبِيِّ ﷺ قَالَ الرَّاكِبُ خَلْفَ الْجِنَازَةِ وَالْمَاشِي أَمَامَهَا قَرِيبًا عَنْ يَمِينِهَا أَوْ عَنْ يَسَارِهَا وَالسِّقْطُ يُصَلَّى عَلَيْهِ وَيُدْعَى لِوَالِدَيْهِ بِالْمَغْفِرَةِ وَالرَّحْمَةِ