• 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.