From the booklet of Rabbi David Shalom Naki, shlit"a: a son must rise in honor of his father even when he enters the synagogue. Although it might seem that one does not show honor to a student in the place of the rav, Chazal taught, as brought in Bava Batra, that this is itself the will of HaKadosh Baruch Hu: that we honor the father even in His house.