Site logo

Archived topic

Including Parent theme file in Child theme

5 replies · Started by Jill on October 28, 2020

Viewing posts 1–6 of 6

Dear Support
To create my site, i had to modify inc>structure>header.php file of parent theme.
so in child theme how i can include that file?
i tried to add that file in child theme (maintaining same structure), but that didnt work
would you mind to kind enough to share me the procedure please?

Kind Regards

Hi there,

I tried to add that file in child theme (maintaining same structure), but that didnt work

That's the correct method. You just need to copy the header.php file and paste it into the child theme folder:
https://github.com/tomusborne/generatepress/blob/master/header.php

What are you trying to modify in the header.php file?

A lot of modification can be done with hooks :)

By default, WordPress only allows child theme overwrites on the first level of files - so the files directly under the theme folder.

What is that code you are trying to add?

Did the source provide any information on how to add it?

Thanks Leo
that is some buttons i wanted to add. and i am coding it using html and css.
i need to add those code in inc>structure>header.php ( as i shown in red block)
so can i add or you can help from theme support to include that file as a part of child theme?
or it is not possible?

This archived topic is closed to new replies.