WordPress.org

Ready to get started?Download WordPress

Forums

Different header for seperate page, same blog (2 posts)

  1. thehowellsnest
    Member
    Posted 4 years ago #

    Hey,

    Is it possible to have a different header image for a seperate page on the blog?

    Rich

  2. krembo99
    Member
    Posted 4 years ago #

    yes...
    And it depends on your theme and design as far as the "how" concerns...

    You can do that based on theme files, custom pages, or a simple IF statement ...

    if (is_category()){

    if (is_category('1')){
    <?php include(TEMPLATEPATH.'/header1.jpg'); ?>
    }
    elseif (is_category('2')){
    <?php include(TEMPLATEPATH.'/header2.jpg'); ?>
    }
    else {
    // this is the deafult header
    <?php include(TEMPLATEPATH.'/header3.jpg'); ?>
    }
    }
    ?>

    or

    <?php if (is_front_page()) { ?>
    <div id=”header”> <!– This is actually changing all the DIV” –>
    <?php } else { ?>
    <div id=”<?php echo $post->post_name; ?>”> <!– alternative header DIV is sent, based on the page title –>
    <?php } ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.