Hey Julian,
I’m a bit confused.. Is that your entire spTopicViewDesktop.php file from your child theme?
If it is, you can’t just add a template to a child theme that only includes the changes you want to make, there is no way for SP to determine where to slot the changes in if you like, it has to be the entire template.
However, if that’s just an excerpt but your code is literally at the top of the template, it looks like the code is in the wrong place. For example using Reboot, you would be looking to add the code to the section
‘# Column 1 of the post row’
which starts on line 131 in the full template. This section contains (in order) avatar, username, location, rank etc.. So just add your custom profile function after location and before rank.
Hope that helps.. Sorry if I’m missing something, if so please explain..