• I’ve been stuck on this for a while now, I’m trying to get a different logo on a single page of a site. I’ve tried stacks of methods with the functions.php file and in the style sheet. The closest i’ve come is changing it through the css but the link broke. This is the site here: https://2cf.bbe.myftpupload.com/financial-services/ and this page has to be styled red rather than green.

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.

    Thread Starter calebloeken

    (@calebloeken)

    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).

    Thread Starter calebloeken

    (@calebloeken)

    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="https://2cf.bbe.myftpupload.com/wp-content/uploads/2016/03/OFFICIAL-Wise-Choice-Financial-Logo.jpg" />
    <?php else: ?>
        <img src="https://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.

    Thread Starter calebloeken

    (@calebloeken)

    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.