• Does anyone know if it is possible to have a different header image display on, say my about page, than the main page? And/or how to do this?

    Thank you.

Viewing 6 replies - 16 through 21 (of 21 total)
  • Thread Starter riasaurusrex

    (@riasaurusrex)

    That code is located in the header.php file.
    Should I make a new header.php file (named aboutHeader.php or something like that) and make the change in that file then?

    If so, where/how do I change which header file the about.php file links to?

    oh my gosh! i’m sorry i was thinking your header image is located in your index.php i realized its in the header.php. Bear with me ok its gonna be more complicated.

    this is what you are gonna do:

    1. duplicate your header.php save it as customheader.php then replace your old image with your new one (make sure you uploaded the actual image file to the same directory) with the last code I gave you. hope this one’s clear…
    2. for your question how to link it with your about.php, open the file (about.php) then replace <?php get_header();?> with <?php get_customheader();?>

    note: <?php bloginfo(‘template_directory’);?>old image directory becomes <?php bloginfo(‘template_directory’);?>new image directory. Just upload your new image file to the same directory as your old image file so you can just edit the file name not the whole directory or subdirectory ok?

    good luck!

    Seems alot of hard work for something so basic…

    Why not just simply do this to your header element in the header.php…
    <?php if(is_page('About')) : ?>class="aboutpageclass"<?php else : ?>class="normalclass"<?php endif;?>

    Which simply switches a class on a element, usage would be like so..

    Example element..
    <div id="header">

    With code added..
    <div id="header" <?php if(is_page('About')) : ?>class="aboutpageclass"<?php else : ?>class="normalclass"<?php endif;?>>

    Then in your CSS apply style to the necessary classes, following the example above, something like….

    Example..

    .aboutpageclass { background-image:someimage.jpg; }
    .normalclass { background-image:anotherimage.jpg }

    Why go through the work of creating a template/page and fiddling with function calls when it’s such a simple and straight-forward task. Not saying the above is ‘wrong’ per say, but i don’t think it need be that much work…

    Thread Starter riasaurusrex

    (@riasaurusrex)

    yeah, i like that idea.
    thanks.

    lhoylhoy,

    I tried using your idea of designing a custom page template himalayas.php and a custom header which I called himalayaheader.php. I tried directing this to a new directory himalaya_images.

    Now I get this error:
    Fatal error: Call to undefined function: get_himalayaheader() in /home/armst5/public_html/MyBlog/wp-content/themes/atahualpa.3.2/atahualpa/himalayas.php on line 14

    What am I doing wrong? The header needs to be directed to a folder that contains several rotating images.

    pavlos1982

    (@pavlos1982)

    i have done this and it works but i want to add it to more pages how to i add another piece of php code for other pages from this code

    <div id=”header” <?php if(is_page(‘About’)) : ?>class=”aboutpageclass”<?php else : ?>class=”normalclass”<?php endif;?>>

    Then in your CSS apply style to the necessary classes, following the example above, something like….

    Example..

    .aboutpageclass { background-image:someimage.jpg; }
    .normalclass { background-image:anotherimage.jpg }

Viewing 6 replies - 16 through 21 (of 21 total)
  • The topic ‘Different header image on About Page’ is closed to new replies.