Childs PHP files not overwriting Parent’s PHP files

I have a php file located at:

.../wp-content/themes/kallyas-child/pagebuilder/elements/TH_TeamBox/TH_TeamBox.php

I’m trying to use the above file to overwrite the parent’s TH_TeamBox.php file which is found here:

.../wp-content/themes/kallyas/pagebuilder/elements/TH_TeamBox/TH_TeamBox.php

My child theme is active and I have created the file path in my child theme to mimic my parent theme. I was under the impression that if I did that I would be able to edit PHP files to my liking in my child theme without losing my changes when I update my parent theme.

I’ve been developing for a while, but as you can see I’m new(er) to WordPress. Any insight on why my child’s .php file isn’t overwriting it’s parent’s .php file would be greatly appreciated. I’d be glad to give anymore info that you might need to assist me, thanks! : )

3 s
3

Child themes are allowed to override templates, not simply arbitrary PHP files.

In WordPress, a theme consists of a bunch of PHP files which are used as Templates. You can find a list of those files in the Template Hierarchy.

Those specific template files can be overridden with new ones, but unless the parent theme has some special means for you to override other files, then files simply included by the parent as part of a support structure or as libraries for a pagebuilder piece of code cannot simply be overridden in that manner.

Leave a Comment