• Resolved smk2004

    (@smk2004)


    Is it possible to have a different header per page? If so can you point me in the right direction. I’ve searched the forums and some mention random images but that is not what I’m aiming for. I would like to have a different specific header on each of my pages.

    Thanks in advance!

Viewing 15 replies - 1 through 15 (of 25 total)
  • Just to clarify: when you say “pages” – are you referring to Pages created in WP or something else?

    If you do mean Pages, then this is possible. Create different templates and then replace the call to the header in each template with a call to the appropriate header, along these lines:

    <?php include(TEMPLATEPATH . '/custom-header1.php'); ?>

    Each of the header files goes in your theme folder.

    Thread Starter smk2004

    (@smk2004)

    Thanks. I understand creating different templates and header pages. But not sure how I would tell each individual page (created in WP) to pull a different header. Could you explain with a little more detail.

    thanks!

    No, you don’t tell Pages to pull a different header. You “tell them” to use a different template (which will call for the specific header as Haecceity described above).

    When you have more than one Page template, in the Write Page area you’ll have a dropdown menu: Page Template where you can select your templates.

    Not sure if this is what you want to do, but:

    https://www.abunchofcars.com/ and notice how there is a big honking picture in the header, click on Featured Rides and notice how the picture changes and so does the size of it and there is text in the grey bar above the menu.

    I just did a bunch of if/else statements and is_page to accomplish that. So basically it loads the 1 default header.php file in my theme but generates different content based on what page it is.

    Thread Starter smk2004

    (@smk2004)

    huh? How do I tell them to use a differnet template without within the same theme?

    Can you tell me the specific code and placement? That will help me determine what I need to do…

    thanks so much!

    To outline the stages for each custom page:

    1. Create a new header file
    2. Create a new page template that calls the header file (using the code above)
    3. Create your page, and select the appropriate template from the drop-down list
    4. Feel pleased with yourself ??
    5. Repeat for the other custom pages

    Thread Starter smk2004

    (@smk2004)

    Thanks for the info…

    Sorry to sound so stupid — but where and how does the instance of the drop down menu list that you are referring occur?

    Look to the right when you’re at “Write > Write Page” and you’ll see a bar that says “Page Template”. Make sure that’s expanded and you’ll see the drop-down list.

    Thread Starter smk2004

    (@smk2004)

    hey thanks!

    Thread Starter smk2004

    (@smk2004)

    ok I was playing around with uploading new header theme pages and my “Page Template” section has dissapeared. I reversed everything I did but still is missing???

    Thread Starter smk2004

    (@smk2004)

    Whoo ?? Seems like for every step forward — I get a step back… Hope I’m not the only one.

    Does anyone know how in the heck your “Page Template” section can suddenly dissappear? Any suggestions on getting it back?

    Thanks!

    You, probably, messed up your Page templates. If WP doesn’t recognize at least 2 (two) Page templates present, the selection box disappears.

    Thread Starter smk2004

    (@smk2004)

    Thanks… I restored the original page.php below is the current code published… BUT WP still is not showing my “Template Page” section on the “write page”??? Do you have any other suggestions?

    [code removed]

    We don’t really need the code here.
    Do you have another Page template – with the proper lines at the top* – in your theme folder?

    * https://codex.www.ads-software.com/Pages#Page_Templates

Viewing 15 replies - 1 through 15 (of 25 total)
  • The topic ‘Multiple headers with different pages…’ is closed to new replies.