סימן קצו סעיף יח
אוֹנֵן בְּלֵיל סְפִירַת הָעֹמֶר, לֹא יִסְפֹּר בַּלַיְלָה, אֶלָּא בַּיוֹם לְאַחַר הַקְּבוּרָה יִסְפֹּר בְּלֹא בְרָכָה. וּבִשְׁאָר הַלֵּילוֹת, יִסְפֹּר אַחַר כָּךְ בִּבְרָכָה. וְאִם רוֹאֶה בַּיוֹם כִּי הָאֲנִינוּת תִּמָּשֵׁךְ עַד הַלַּיְלָה, יִסְפֹּר אֲפִלּוּ בַאֲנִינוּת בְּלֹא בְרָכָה, כְּדֵי שֶׁיִסְפֹּר שְׁאָר הַלֵּילוֹת בִּבְרָכָה (אוֹנֵן בַּפּוּרִים, עַיֵן לְעֵיל סִימָן קמא סָעִיף כא).
If a person is an onein on a night when the omer is counted, he should not count at night, rather on the following day after the burial, he should count the omer without a berachah. [However], on the following nights, he may count the omer with a berachah. If he sees during the day that he will retain the status of an onein until night, he may count the omer even while he is an onein but without a berachah, so that on the following nights he may count the omer with a berachah
תנא דבי אליהו כל השונה הלכות בכל יום מובטח לו שהוא בן העולם הבא שנאמר הליכות עולם לו אל תקרי הליכות אלא הלכות (נדה ע"ג.)