WordPress.org

Ready to get started?Download WordPress

Forums

Different header on each page or post (7 posts)

  1. tronicman1
    Member
    Posted 2 years ago #

    Hi,

    I´ve been told that a custom header on each page was part of WP.

    WP Save Custom Header
    This plugin is DEPRECATED with WordPress 3.2. Since its functionality is incorporated into WordPress core, this plugin will be no longer supported!

    But how does it work? I cannot find any hint - something like a dropdown menu for the header images.
    I tried to install the WP Display header plugin. But it doesn´t work with my theme. Any idea what I could do??

    Hope anyone can help me!

  2. likethegoddess
    Member
    Posted 2 years ago #

    Have a look at conditional tags for assigning your custom headers to specific pages.

  3. tronicman1
    Member
    Posted 2 years ago #

    Thanks, likethegoddess, that sounds good.
    But I don´t know much about PHP programmming...

    Can you tell me, what to insert to make it show a certain header when the condition is true??

    I guess it should be something like that example code:

    ` if ( is_page( 'About' ) ) {
    // our about page.
    echo ......;
    } elseif ( is_page( 'Colophon' ) ) {
    echo "" . bloginfo( 'version' ) . "</p>";
    } else {
    ....`

    So, what should I write in my special case after "echo??

  4. likethegoddess
    Member
    Posted 2 years ago #

    Echo can be very useful. It's not what you want to use here though, because echo is executed after the page structure has been assembled. You want to intercede when your page.php is adding the header.

    Something like:

    if ( is_page( 'About' ) ) {
    get_header(about);
    } elseif ( is_page( 'Colophon' ) ) {
    get_header(colophon);
    } else {
    ....

    You sub that code in for your standard <?php get_header(); ?> tag in page.php and create your custom header file, in this example header-about.php and header-colophon.php.

    While I'm thinking on it, I've used this technique with custom sidebars, not yet with custom headers. I expect it'll work the same way.

  5. Konstantin Obenland
    Member
    Posted 2 years ago #

    Hey tronicman1,

    WP Save Custom Header adds the posibility to save uploaded header images and make them part of the selection.

    To be able to choose a specific header image for an individual post or page, I created WP Display Header. It adds a meta box to the editor screen where you can choose the image.

  6. tronicman1
    Member
    Posted 2 years ago #

    @Konstantin Obenland

    Thanks, but I installed it, yet.
    Unfortunately comes the message that it wouldn´t work with my theme (I´ve been asking you some days ago, on your Plugin site).

    What do I have to do to make my theme work with WP Save Custom Header??

  7. Konstantin Obenland
    Member
    Posted 2 years ago #

    You could upgrade to the latest version of WordPress. Then you don't need the plugin.

    Your theme has to support the header business though.
    See this post on how to achieve that: http://www.wpbeginner.com/wp-themes/how-to-enable-custom-header-images-panel-in-wordpress-3-0/

Topic Closed

This topic has been closed to new replies.

About this Topic