• I have searched, again, for a while for a solution to this, with no luck. What I need is to be able to have an image in my header change (specifically, not rendomly) with each page.

    Again, I am pretty experienced, and will write or co-write a plugin if necessary, but would rather not hack the code, unless it is theme specific.

    Thanks!

Viewing 13 replies - 1 through 13 (of 13 total)
  • You can have as many Page templates as you want…hence as many differing headers.

    Thread Starter deltina

    (@deltina)

    But can that control the header.php as well? since that is where the header image is determined

    Good point. A lot depends on exactly what you wish to accomplish.

    If we’re just switching header images, I’d use Conditional_Tags in my header.php to detect what sort of page we’re on.

    Thread Starter deltina

    (@deltina)

    Thanks! I will try that and see how it goes…

    Thread Starter deltina

    (@deltina)

    Just for the record, I ended up using page templates for this,after all. Worked great – thanks!

    So if you use page templates, does that mean you should have different header.php’s? or is the header defined directly in the page template?

    and can you use page templates for posts as well? if you want different headers to appear for posts as well, is this still the way to go?

    (thankful for any answers)

    if you use “conditional tags” such as “in_category” for posts, where should the “if in_category” statement be? in the post.php?

    Thread Starter deltina

    (@deltina)

    Sorry, Sailor, didn’t realize there were any replies here…

    What I did was define a different CSS style for each header (really the same style, just referenced different images), and used them repectively in each template.

    So, no, not different header.php files, just different style references – but this particular header is in the body tag, not the header tag…

    And you definitely want to use category templates to change the headers or anything else for different posts. I found that easier that using conditional tags.

    I have done this by having different header files and by using the following to call them in the various page templates:

    <?php include(TEMPLATEPATH . '/header-daily-life.php'); ?>

    It does make for a lot of files in the theme directory, but it works just fine.

    Thread Starter deltina

    (@deltina)

    I may be showing my ignorance, here, but isn’t that SEO suicide? I mean, how does a spider know where to go to index the site, if there is more than one header file?

    Why should it make any difference to a search engine? Search engines spider pages by following links, and that’s unaffected.

    It’s simply that my pages have different designs in the headers. To a search engine that’s irrelevant.

    Thread Starter deltina

    (@deltina)

    I guess I am just confused.

    Thanks!

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘different header for each page’ is closed to new replies.