To set a different header per page in WordPress, I usually edit php get_header(); line in theme files such as index.php, page.php...
I wonder if it's possible to change the header file per page with 'get_header' action without editing theme files such as page.php.
I tried the following code, but it didn't work.
function themeslug_header_hook( $name ) {
if(is_front_page() || is_home()) {
$name = 'home';
}
$return $name;
}
add_action( 'get_header', 'themeslug_header_hook' );
Is there any way to set a different header per page within the functions.php file?
Thanks.