Wordpress - Childs PHP files not overwriting Parent's PHP files

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.


The solution is to move the required changes to your child theme functions.php file.

If it is a function, usually there were will be an if statement that checks if it is already declared, in this case you can copy the function to functions.php with the same name and make the required changes, it will have priority over the rest of the theme files. In case the function was declared without an if statement, then you have to change its name in functions.php, find the template file the functions is called, copy it to your child theme and change the function call in it.

If it is a widget, then copy the whole class declaration to functions.php, change its name and make the other changes. Make sure you also register the new widget and you will find it available in the widgets area with the new name and changes.