SANTA CLARA, Calif. -- The day surely didn't start out the way 49ers head coach Kyle Shanahan wanted Sunday.

That's what made the ending that much sweeter.

Shanahan met first thing with wideout Marquise Goodwin, whose infant son had died overnight as a result of complications in his wife's pregnancy.

"I've been with players who lost one of their parents the days before games. I think everyone reacts differently to that stuff," the coach said. "I've had some people who a death happens and they can't see anyone, and they have to go home right away. You totally understand that and respect it.

"I know Marquise was hurting bad, real bad. He was adamant he wanted to play. You don't want someone just to tell it to you because that's what you want to hear as a coach. You want someone to tell it to you because they mean it. And you could tell 'Quise meant it."

Then something amazing happened, almost as if planned. The 49ers scripted a touchdown celebration for a guy who hadn't scored all season, and then were able to put it in action following an 83-yard touchdown reception by Goodwin in the second quarter.

Goodwin dropped to his knees in the end zone following the score and, surrounded by teammates, pointed the football toward the heavens in about a 10-second, silent tribute.

"When he scored, I knew we were going to get a delay of game. I knew he was going to be in that end zone for a while, so I planned for it," Shanahan noted. "Fortunately, the refs gave us a little more time than usual."

Comment about 49ers goodwin had a special td celebration