Support » Fixing WordPress » Different site logo for a single page of site

Viewing 6 replies - 1 through 6 (of 6 total)
  • You would be best using something like this:

    <?php if( is_page( $special)page_id ) ); ?>
        <img src="red_logo.jpg" />
    <?php else: ?>
        <img src="green_logo.jpg" />
    <?php endif; ?>

    You just need to know the ID of the page that you’re chainging it for.

    Where would I enter the page ID?

    I just realised that I had a type in the code above. 🙁

    This is what it should be.

    <?php if( is_page( $special_page_id ) ); ?>
        <img src="red_logo.jpg" />
    <?php else: ?>
        <img src="green_logo.jpg" />
    <?php endif; ?>

    You’d either set it as $special_page_id = **Your page ID**; or you would just replace the variable with the ID in the code like <?php if( is_page( 123 ) ); ?> (assuming that your page ID is 123).

    hmm… still not working i’m afraid. It says there’s a Parse error on line 3. I’m new to PHP so any help would be great. Thanks in advance.

    <?php if( is_page( 49 ) ); ?>
        <img src="http://2cf.bbe.myftpupload.com/wp-content/uploads/2016/03/OFFICIAL-Wise-Choice-Financial-Logo.jpg" />
    <?php else: ?>
        <img src="http://2cf.bbe.myftpupload.com/wp-content/uploads/2015/11/OFFICIAL-Wise-Choice-Logo-Final.jpg" />
    <?php endif; ?>

    I should know better than to try and do this without testing it myself…

    <?php if( is_page( 49 ) ): ?>

    It was the ; that should have been : instead.

    That fixed the error but it’s added a big logo at the very top of the page. Any other suggestions? Is there a way to select the class of the logo to swap it out?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Different site logo for a single page of site’ is closed to new replies.