This conversation sure has gotten derailed. Let's see if we can bring it back. ;)
I have this weird situation whereby code gets written to my child themes, function.php.
From your posts, it's not really clear if code is actually being added but if any files are being updated and it's not you that's updating them, then your site is hacked. Plain and simple, no if, ands, or buts.
See above for steps to remedy that.
I am using Trim theme by Elegant Themes. I created a child theme.
Regarding that link you posted just above: as Esmi indicated you really want to speak to your theme vendor about how to child one of their themes.
The child theme's
functions.php file gets executed before the parent theme does. If you want to use a function from the parent theme then you either need to defined it first (and possibly break he parent theme's
functions.php if it's not prepared for that) or figure out a way to filter that function via a queued up filter or action.
By queuing up the filter or action late enough then it will happen after the parent
functions.php file is ran and all is right in the world. That's not a trivial thing to do if you don't know how, and not all parent themes make that doable.
It looks like you're trying to use a parent theme function in your child theme from a commercial parent theme. If that's the case, then use the vendor for support. It's part of what you paid for.