שולחן ערוך, יורה דעה שנ״ח

Shulchan Arukh, Yoreh De'ah 358

נושאי המטה פטורים מקריאת שמע ומתפלה. ובו ג' סעיפים:
נושאי המטה וחלופיהן וחלופי חלופיהן בין אותם שהם לפני המטה בין אותם של אחריה מאחר שלמטה צורך בהם פטורים (מקריאת שמע) ושאר המלוין את המת שאין למטה צורך בהם חייבים (ועיין בא"ח סימן ע"ב):
They who carry the bier and they who relieve them and they who relieve these, both they who go before and they who follow the bier, — [the law is that] they who are needful for the bier are exempt (from reciting the Shema), and the others who follow the corpse, who are not needful for the bier, are not exempt.
אין מוציאין את המת סמוך לק"ש כל שאין שהות להוציאו לקברו קודם שיגיע זמן קריאת שמע ואם התחילו להוציאו אין מפסיקין כדי לקרות: הגה ויש להמתין מלקברו עד שיוכלו לשער שכבר התפללו רוב הקהל ואין חילוק בזה בין ק"ש של שחרית לק"ש של ערבית ויש מקילין בשל ערבית הואיל וזמנה כל הלילה (מבואר בא"ח סימן ע"ב):
The corpse is not brought out [for burial] close to [the prescribed period] for the reading of the Shema whenever there is no time to bring him out [and] to bury him before the time for the reading of the Shema arrives; but if they had [already] commenced to bring him out, they do not desist in order to read [the Shema]. Gloss: One must wait with the burial until it may be estimated that the majority of the community had recited the Tefillah; and there is no distinction in this [respect] between the reading of the morning or the evening Shema. Some are lenient regarding the evening [Shema] since its [prescribed] time extends throughout the night.
במקום שיש כתפים מיוחדים לשאת את המטה אסורי' בנעילת הסנדל שמא יפסיק סנדלו של אחד מהם ונמצא מתעכב מהמצוה: הגה יש מקומות שנהגו שהאבלים יוצאים ראשון מן הבית והקרובים והמטה אחריהם והרחוקים נותנין המת על המטה ולוקחים האבלים והקרובים המטה על כתפיהם ואחר כך שאר העם (כל בו) יש אומרים כשמגיעים עם המת לקברות מעמידים אותו כל ד' אמות קודם שנקבר (שם וב"ז) וכן נהגו האידנא להעמידו ב' ג' פעמים קודם שאומרים עליו צדוק הדין ובימים שאין אומרים צדוק הדין אין צריכים להעמיד אותו (מ"כ בשם מהרי"ל):
In a locality where there are appointed pall-bearers to carry the bier, they [the pall-bearers] are forbidden to put on sandals lest [a thong] of one's sandal break with the result that he is prevented from [observing] the religious act. Gloss: There are localities where it is customary that the [immediate] mourners leave the house first and [then] the relatives and the bier after them, and the strangers place the corpse on the bier, and the [immediate] mourners and the relatives take the bier on their shoulders and afterwards [this is done by] the rest of the people. Some say that when they arrive with the corpse at the graveyard, they make halts with him [the corpse] every four cubits before he is buried. Thus is the common practice today,—to make halts with him two or three times before they recite Ẓidduk Haddin for him; and on days when Ẓidduk Haddin is not recited it is unnecessary to make halts with him.

Ashlei Ravrevei: Shulchan Aruch Yoreh Deah, Lemberg, 1888 (Public Domain) · Code of Hebrew Law by Chaim N. Denburg, Montreal, 1955 (CC-BY) · 3 se'ifim