If i use a child theme to add new code blocks to header.php, how does it get inserted in the right place in parent's header.php?

by bluedimensional   Last Updated March 14, 2019 20:08 PM

I want to add <ul><li><a href="link">Link</a></li></ul> to my theme's header.php. This is new code that doesn't already exist anywhere. I have created a child theme.

I've already put this code in parent theme and it works, but i want to do it correctly and use the child theme. So, if i create a header.php file in my child theme, and then say i put in that line of code, how would it know where the code goes relative to all the rest of the parent's header.php code?

I am guessing this is where i use actions, hooks, just not sure how to start. Or maybe i cut everything from the parent's file and paste it in . child's? That sounds like would work in theory but i can't imagine that's the right way.

How do i go about using the child's header.php to insert code into specific parts of the parent's header.php?

Related Questions

Updated April 01, 2018 19:08 PM

Updated July 19, 2018 09:08 AM

Updated January 04, 2019 06:08 AM

Updated October 13, 2016 09:03 AM

Updated December 17, 2018 08:08 AM