I would like to use create a function in my custom plugin to tell WP to use a different header
I am not sure what you want to do is doable (seems impossible to me but everything seems impossible until someone does it). I thought of a very ugly workaround. add_filter( ‘template_include’, function( $template ) { $temp = get_temp_dir() . basename( $template ); file_put_contents( $temp, str_replace( ‘get_header(‘, ‘get_header2(‘, file_get_contents( $template ) ) ); return $temp; … Read more