It is sunnah to place a body in the grave with its feet first, if this is possible and can be done easily. This is based on a hadith reported by Abu Daw’ud, Ibn Abi Shaibah, and Al-Baihaqi that Abdallah ibn Zaid placed a body with its feet first in the grave and said, “This is sunnah.” If this is not easy, then a body could be placed in the grave in any manner possible.
Ibn Hazm said: “A body may be placed in the grave in any manner possible, from the direction of the qihlah, or from a direction opposite to it, with its head first, or with its feet first, for there is no explicit instruction regarding this in the texts.”
An-Nawawi said: “You should know that the right manner of accompanying a funeral procession is to remain quiet, as the pious among the previous generations of Muslims did. One should not raise one’s voice for recitation or for the remembrance of Allah, or for anything else. Keeping quiet is better and is helpful in concentrating one’s attention on the funeral rites, which is needed at that time. This is the correct position, and the fact that a large number of people do otherwise does not change it. There is a consensus among scholars that the way ignorant people recite in the funeral processions, artificially prolonging sounds of various words and mixing them up, is forbidden.