D
D
Denis99992018-06-11 17:56:45
WordPress
Denis9999, 2018-06-11 17:56:45

Principle of replacing template files with child theme files in Wordpress?

In practice, everything works just as it is written in the documentation:
Templates in a child theme behave the same as style.css, they replace the corresponding parent theme files.
For example, I need to add a block to header.php , so I need to duplicate header.php and add the right block. But what if, when updating the parent theme, it turns out that changes were made to header.php, as a result, it turns out that some of the changes related to header.php will not be made due to the fact that there is a similar file in the child theme.
How do you usually get out of this situation? Is there any solution here?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Yanchevsky, 2018-06-12
@Denis9999

Some themes have hooks with which you can adjust the display of certain elements and add your own without redefining the template. If there are no hooks, then you will have to redefine the template.
Changes in the theme can be tracked locally, as azerphoenix already suggested , or with trac .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question