Archived topic
How to create a header.php file inside the Child theme
8 replies · Started by Birhon on September 4, 2018
Hello,
I have a multisite
I am trying to find out how i would be able to add a header.php and footer.php file inside the Child theme
where I will be able to store my header information (logo or banner Main menu and secondary menu) and footer information.
This way it will allow me to make changes once in the php file and take effect on all my sites on my multisite network.
I have seen this done before but I need to see it done on the generatepress child theme
Thank you
Hi there,
You would need to copy the header.php file in the parent theme, and paste it into your child theme.
Then you can make whatever necessary changes in there.
Once you do that, I believe you can network activate the child theme so it's active across all of your sites.
Let me know :)
Thank you for that
Another thing, if this does not work for me
Is there another way I could make the child theme have a multisite header and footer?
I need to be able to store the header and footer information in the child theme
So that with every site activation all the information will be available.
And with any new information, I will need to change it on the PHP file in the child theme
Or is there a better way?
Hello,
In other words, I would like to be able to hardcode in the header/footer.php file
I was not able to find the header and footer on the main theme
could you direct me to it?
Thank you so much for all your help.
What changes are you wanting to make? You can use functions to filter their output, and add those functions to your child theme.
Hello, Tom
I am trying to set up a multisite network
One that will allow me to share a global header and footer through the network
Global Header
Top menu
Banner, logo and/or slider
Main Menu
Local Content
Global Footer
Textbox
Footer Menu
Textbox
What would it be the best way to do it using your framework?
One way I have seen it done was hardcoding the header and footer content on a PHP file
this way the header and footer will be ready with every site activation.
Yea, I think that would be the only way to do it.
How would the menus be shared among the sites?
Hi Tom, when you copy header.php to the child theme do you keep all of the code? Or just the pieces you're editing? I'm adding an Adobe font to the header.
Thanks!
You need to copy all the code :)