Welcome to WebmasterWorld Guest from

Forum Moderators: rogerd & travelin cat

Message Too Old, No Replies

How can i ADD different header on each page on wordpress?

ADD different header on each page on wordpress?

10:45 am on Dec 21, 2011 (gmt 0)

New User

joined:Dec 20, 2011
posts: 8
votes: 0

I just wondering if i can put different header on each page?

This is my sample site and i'm using a plugin Header Slideshow SampleSites/

is it possible?

your response would help resolve my problem

Thanks in advance :)
4:33 pm on Dec 21, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
votes: 0

$someheader = 'this-page-header';
// Or some logic that sets $someheader based on the page


A less graceful way to go about it (as far as programming) - but would give you more control from the admin interface - is to create a custom field that sets what header to use. If you don't set it, it uses the default header.

So let's say in custom fields you create a field 'custom-header' and set the value 'third-page'. Wordpress looks for files that begin with 'header', so this would turn into 'header-third-page'.

$check_custom = get_post_meta(get_the_ID(),'custom-header',1);
$this_header = (! empty($check_custom))?'header-' . $check_custom:null;


So for no custom field value you get the standard


for a page with "third-page" set for the custom-header field you get


(quoting is not necessary for variables but if you DO quote, use double quotes, not single quotes, or the variable won't interpolate.


12:12 pm on Dec 22, 2011 (gmt 0)

New User

joined:Dec 20, 2011
posts: 8
votes: 0

thanks man

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members