Problem changing header img on a different page. (4 posts)

  1. kandik
    Posted 4 years ago #


    I was trying to create a page with a different header when I came across this code i could not understand. Im using WordPress 3.3.1 and UpStartBlogger Modicus 2-Colum 0.3 Theme. The website is http://www.tallinnlooks.com

    This is the code from header.php:

    [Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

    I am trying to add a code there that should show a different header on the page "test".I used the following code:

    echo '<img src="" />';

    But it does not show properly.
    I am guessing there is something wrong with <a href=""></a> being outside of php code??? When i tried to change that the website didnt display properly. When i wrote that code into the original header code it worked and changed the "test" page header, but then the homepage header dissapeared.

    Could someone please help and point out what i am doing wrong?

  2. esmi
    Forum Moderator
    Posted 4 years ago #

  3. gerald@WPcustoms
    Posted 4 years ago #

    make sure to adjust your main header image here: <img src="your-other-header-img.jpg" />:

    <div id="header">
    <?php if(is_page('test')){ ?>
    <a href="<?php bloginfo('url'); ?>" title="<?php bloginfo('name'); ?>">
    <img src="" />
    <?php } else { ?>
    <a href="<?php bloginfo('url'); ?>" title="<?php bloginfo('name'); ?>"><img src="your-other-header-img.jpg" /></a>
    <?php } ?>

    hope that helps :)

  4. kandik
    Posted 4 years ago #

    Yes it worked, thank you very much!
    Just not enough experience with php.

Topic Closed

This topic has been closed to new replies.

About this Topic