Vicky Picky
Vicky Picky

Reputation: 67

Wordpress custom header files for different pages?

I'm wondering if it is possible to call different headers like for the get_sidebar(‘newsidebar’)? can I maybe call get_header('custom')? I want to make my header for the index different then all the other pages

Upvotes: 2

Views: 4600

Answers (2)

Abel
Abel

Reputation: 594

Multi headers

Different header for different pages.

<?php
if ( is_home() ) :
get_header('home');
elseif ( is_404() ) :
get_header('404');
else :
get_header();
endif;
?>

The file names for the home and 404 headers should be header-home.php and header-404.php respectively.

Upvotes: 5

SimonW
SimonW

Reputation: 6423

Sure you can, view the codex: http://codex.wordpress.org/Function_Reference/get_header

Upvotes: 1

Related Questions