Changing the header php file in wordpress

asked Oct 14, 2012 in Website Builder by SaraSX (2,770 points)
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 like 0 dislike
answered Oct 14, 2012 by SmartHost (9,060 points)
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 like 0 dislike
answered Oct 14, 2012 by FixHost (12,380 points)
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