It is narrated from Ubayd, the freed slave of al-Sa'ib, "that he saw Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) and Ubayd bin Umayr walking in front of a funeral in the upper part of Makkah: the two of them would go ahead of the funeral and sit down, then when the funeral passed by them they would stand up." Imam Musaddad recorded it, and its narrators are thiqat (trustworthy); Imam Ibn Hibban also transmitted it in his Sahih.
It is narrated from Sayyiduna Abu Umamah (may Allah be pleased with him) that Sayyiduna Abu Sa'id al-Khudri (may Allah be pleased with him) said to Sayyiduna Ali (may Allah be pleased with him): "O Abu al-Hasan! Tell us about walking with a funeral: which way of doing it is more virtuous?" Sayyiduna Ali (may Allah be pleased with him) said: "By Allah! The virtue of walking behind the funeral over walking in front of it is like the virtue of the obligatory prayer over the voluntary prayer." Sayyiduna Abu Sa'id (may Allah be pleased with him) said (in surprise): "By Allah! Ever since I attended a funeral with Sayyiduna Abu Bakr and Sayyiduna Umar (may Allah be pleased with them both), I have not abandoned (this way); I saw the two of them walking in front of the funeral." Sayyiduna Ali (may Allah be pleased with him) said: 'Yaghfirullahu lahuma' (May Allah forgive them both). Certainly the best people of this ummah after its Prophet (peace and blessings be upon him) are Sayyiduna Abu Bakr and Sayyiduna Umar (may Allah be pleased with them both); then Allah knows best where goodness lies. And if you saw the two of them doing that, they did it while knowing well that the virtue of walking behind the funeral over walking in front of it is like that of the obligatory over the voluntary, just as you know that before tomorrow there is a night; but the two of them liked to make things easy for the people and disliked putting them in difficulty, because they knew that they were followed. He then asked: "O Abu al-Hasan! Tell me about carrying the funeral: is it obligatory on the one who attends it?" He said: "No, rather it is a good deed: whoever wishes may carry it and whoever wishes may leave it. So when you are with a funeral, keep it in front of you and make it the focus of your eyes, for it is an admonition, a reminder and a lesson. Then if you intend to carry it, look for the rear left leg of the bier and place it on your right shoulder. Then when you reach the graveyard, remain standing and do not sit, for you are witnessing a tremendous matter. Indeed, I heard the Messenger of Allah (peace and blessings be upon him) say: 'Your brother, your brother; who used to compete with you in the world and quarrel with you, for whom the expanse of the earth would become narrow because of palaces, has been placed inside the grave, into a dug-out grave (lahd), on his side. So remain standing and do not sit until the earth has been levelled over him. Then if the people do not leave you alone, and they will not leave you alone, and they say: By Allah, this is nothing, still remain standing and do not sit until he has been lowered into his pit, even if they fight you over it.'" Imam Ishaq bin Rahwayh recorded this hadith with a da'if (weak) chain, because Mutarrih bin Yazid in it is a weak narrator; and Imam al-Bazzar recorded it with a chain that contains Atiyyah al-Awfi.
It is narrated from Abdullah bin Yasar (may Allah have mercy on him) that Sayyiduna Amr bin Hurayth (may Allah be pleased with him) visited Sayyiduna al-Hasan bin Ali (may Allah be pleased with them both) when he was ill, while Sayyiduna Ali (may Allah be pleased with him) was present with him. Sayyiduna Amr (may Allah be pleased with him) asked him: What do you say about walking in front of the funeral? Sayyiduna Ali (may Allah be pleased with him) said: "The virtue of the one who walks behind the funeral over the one who walks in front of it is like the virtue of the obligatory prayer over the voluntary." He said: I have seen Sayyiduna Abu Bakr and Sayyiduna Umar (may Allah be pleased with them both) walking in front of the funeral. Sayyiduna Ali (may Allah be pleased with him) replied: "Those two elders adopted this (walking in front) because they disliked putting the people in any hardship or difficulty." Imam Ishaq bin Rahwayh transmitted this narration. The wording of Ahmad bin Mani''s narration is that Sayyiduna Amr bin Hurayth (may Allah be pleased with him) visited Sayyiduna al-Hasan bin Ali (may Allah be pleased with them both) when he was ill, and Sayyiduna Ali (may Allah be pleased with him) said to him: "Are you visiting al-Hasan while there is in your heart what there is (of ill feeling)?" Sayyiduna Amr (may Allah be pleased with him) said: You are not my Lord, to turn my heart wherever you wish. Upon this Sayyiduna Ali (may Allah be pleased with him) said: "In any case, that does not stop us from giving you sincere advice. I heard the Messenger of Allah (peace and blessings be upon him) say: 'Whenever a Muslim visits a Muslim brother of his who is ill, Allah Almighty appoints for him seventy thousand angels who keep supplicating for mercy for him, from whatever hour of the day he visits until evening, and from whatever hour of the night he visits until morning.'" Then Sayyiduna Amr (may Allah be pleased with him) asked him: What is your view about walking with the funeral, in front of it or behind it? Sayyiduna Ali (may Allah be pleased with him) said: "The virtue of walking behind the funeral over walking in front of it is like the virtue of the obligatory prayer in congregation over praying alone." Sayyiduna Amr (may Allah be pleased with him) said: I have seen Sayyiduna Abu Bakr and Sayyiduna Umar (may Allah be pleased with them both) walking in front of the funeral. Sayyiduna Ali (may Allah be pleased with him) said: "The two of them did that only because they disliked putting the people in any hardship or difficulty." Imam al-Harith, Imam Ahmad bin Hanbal and Imam Ibn Hibban in his Sahih recorded this narration; Imam Abu Dawud also transmitted it in his Sunan in abridged form, and this narration has already passed in the chapter on visiting the sick.