Hello,
The code you have posted is not using any template method nor replacing any variable in the footer, it adds a header.
Adding headers do not remove/change footers, only existing headers are replaced. We have done some quick tests and everything is working correctly when adding headers/footers and also when replacing placeholders in them.
If you need to work with headers/footers per section, please check the documentation available on https://www.phpdocx.com/documentation/cookbook/headers-and-footers-for-sections.
For further support:
Please send to contact[at]phpdocx.com the username or email of the user that purchased the license you are using, and the most simple script (and template) that illustrates your issue so we can check it.
Regards.