Web Hosting Geeks | Web Hosting Experts
Need help? Call us 1(866)TOP-HOST

14217 reviews 1686 hosting providers

Questions & Answers

Changing the header php file in wordpress

Oct 15, 2012 by SaraSX
Hi guys,
I want to add two header files that are .php files which I have created so that they would show up on  my website’s pages that display that header. I don’t know how to do this, and I was wondering if anyone here can help me or let me know if there’s a plugin that can do this?
I would appreciate any advice
Many thanks

2 Answers

0 votes
Oct 15, 2012 by SmartHost
You can do this by creating new page templates and then using your code to replace get_header of the new page templates. You can use this new template to the requested pages.
0 votes
Oct 15, 2012 by FixHost
Try the following
1.Name your header files as (for example) header-abc.php and header-def.php
2.In your template files (index.php, single.php  or page)  go to the below function: get_header() and replace it by the below two functions
get_header('abc'); or
get_header('def');