為不同的頁面調用不同的頭部文件header.php

if ( is_front_page() ) :
get_header( 'home' );
elseif ( is_page( 'About' ) ) :
get_header( 'about' );
else:
get_header();
endif;

將以上代碼加入調用的header中,會根據不同頁面調用不同的header文件,分別為header-home.php與header-about.php,默認為header.php