Conditional Headers, Sidebars and Footers

WordPress’s get_header() accepts a parameter to specify a specialized header to be included. Therefore, if you want to include headers according to conditions in a template file, simply pass a parameter specifying which header to be included to get_header() .

For example, below code includes header-home.php for the front page but normal header.php for the others in a template file.

if ( is_front_page() ) :
    get_header( 'home' );

get_sidebar and get_footer() also accept such a parameter. They can be used to include a specialized sidebar or footer according to conditions.