Title: get_header using header.php from old theme
Last modified: August 19, 2016

---

# get_header using header.php from old theme

 *  [charlesolaes](https://wordpress.org/support/users/charlesolaes/)
 * (@charlesolaes)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/get_header-using-headerphp-from-old-theme/)
 * I needed to switch to a different template at certain pages but when I use this
   piece of code
 *     ```
       add_filter('home_template', 'myfunction');
   
       myfunction(){
          //testing on windows
          return 'C:\var\www\wordpress\wp-content\themes\DLMobile\index.php';
       }
       ```
   
 * it uses the correct template file but get_header() still gets the header.php 
   from the original theme.
 * My question is: is there a way to override the existing theme without actually
   using switch_theme? I tried using add_filter on the ‘theme’ hook but it’s still
   getting the same header.
 * thanks

The topic ‘get_header using header.php from old theme’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [charlesolaes](https://wordpress.org/support/users/charlesolaes/)
 * Last activity: [15 years, 1 month ago](https://wordpress.org/support/topic/get_header-using-headerphp-from-old-theme/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
