error in extras.php / child theme problem

Line 629:

style type=“text/css” id=“illdy-about-section-css”

should be

style type=“text/css” id=“illdy-jumbotron-section-css”

otherwise the W3C validator throws an error because of duplicate ID.

Also, style type=“text/css” should be omitted

I tried to solve this by putting /inc/extras.php in the /illdy-child directory, but ILLDY still uses the original extras.php. What can I do to get ILLDY to use the Child Theme’s extra.php?

Cheers,
Alex

Hello Alex

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

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.

Quote from this page: Childs PHP files not overwriting Parent's PHP files - WordPress Development Stack Exchange

Hi!

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

Not to be picky but I think the solution (in this case) is to correct the error in the next update of ILLDY :wink:

BTW: I like your coding. It is very uncluttered, so to speak. Something you don’t often see in WP themes …

Cheers,
Alex

Hey there

Alex, i agree with you but at this moment I don’t have any permanent solution for you, this is what we have in our hands right now :slight_smile:
thank you for kind words :slight_smile: