• Resolved hernanhms

    (@hernanhms)


    I know that you customize on the child because if you override on the parent, once you update it will all erase, so you make modifications on the child so it won’t override your edits. So what if i want to modify the nav_menu_walker which is in the parent theme>inc>menu>menu.php, if i override something there will it erase and go back to how it was before or will it stay how i made it since it’s not the style or anything like that im overriding.

Viewing 1 replies (of 1 total)
  • Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Hi hernanjms!

    This really would depend on how the theme loads those files. If it a file within the core template hierarchy then a child theme will override that. A child theme can also override a parent theme with a few other functions as well.

    One of which is the get_template_part function. It first looks in the child theme’s folder and then the parent for the file. If no file is found it won’t load it.

    Another function that has the ability is get_stylesheet_diretory_uri because it uses the location of the active theme’s folder.

    Do note that a child theme doesn’t have to override an entire file either. You can use hooks/filters to change the way the parent theme can behave as well. ??

    As you can see there are quite a few ways for a child theme to override a file. One way that it cannot though is by using the require|include functions that basic PHP has.

    I hope that helps shed some light for you!

Viewing 1 replies (of 1 total)
  • The topic ‘If i override menu.php on parent theme will it restore after an update?’ is closed to new replies.