How to duplicate a page template but make minor changes to the header?

I will apologize in advance, I am very new to this. I have been teaching myself php as a hobby, but now I need it for work! I don't work as a web designer, but to try and save some money, I need to be able to make minor changes to our website.

I can handle most things... But this one issue is throwing me for a loop.

The page was designed by a "marketing firm" and the code is a mess. There's stuff that's old that the site isn't even using, but I am afraid to mess with that. It is making finding what I need to find, a bit difficult.

The header for the page has an image on it. I need to make a new page in addition to the one that is already created -- it's just a one page type website. I need to make a page for a locations map plug-in. I have everything working just fine... The new page is created, the locations map plug-in code is working, but I need to get rid of the header image! I can't find where I change the code.

I made a duplicate of the main page theme, and took out the bulk of what is on the main page. There's NOTHING for the header. When I go into the header.php file, I see where it needs to be changed, but if I duplicate it, give it a new name, and change the code to suit my needs, where in the code do I direct the new duplicate template page to pull that new duplicate header info?

Is this even possible?

Topic headers page-template templates Wordpress

Category Web


Create a child theme, in which you can create a new header file for your different page template as you want it to be.

Let us say your new header file is header-new.php. Now call this header file in your page template as get_header( 'new' ).

This is how you can have different header files for different templates and call the respective header files.


Your best bet is to rename the old header.php to header.bak.php and your new copy to header.php. header.php (there's only one such file, always) is called from the other theme templates using get_header(). What you could/eventually should do, if you don't want to directly edit the existing theme, is set up a child theme, copy over header.php to that child theme's directory, and edit it there. If the theme was custom-made and isn't going to be updated anyway, you might however skip that part. Just make sure there's a backup.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.