• Hi, so I want to have a different logo on different pages.

    This is the code in themes header.php:

    <div class="header">
    <?php  //Display Logo Background if option is checked
    if ( bwthemes_option( 'logobg_checkbox' ) ) {
    echo '<div class="logowrapper">';
    }
    else
    {
    echo '<div class="nologowrapper">';
    } ?>	
    						
    <!--Website logo-->
    <a id="custom_logo" href="<?php echo home_url(); ?>"><img src="<?php header_image(); ?>" height="<?php echo get_custom_header()->height; ?>" width="<?php echo get_custom_header()->width; ?>" alt="<?php echo bloginfo('description'); ?>" /></a>
    </div>
    
    </div><!-- header -->

    And this is how I imagined it to work (but it doesn’t):

    <!--Website logo-->
    <?php  //dipslay member logo on member pages
    if ( is_page( array( 1816 ) ) ) {
    <a id="custom_logo" href="<?php echo home_url(); ?>"><img src="https://website.com/img/green-logo-member.png" height="<?php echo get_custom_header()->height; ?>" width="380" alt="<?php echo bloginfo('description'); ?>" /></a>
    }
    else
    {
    <a id="custom_logo" href="<?php echo home_url(); ?>"><img src="<?php header_image(); ?>" height="<?php echo get_custom_header()->height; ?>" width="<?php echo get_custom_header()->width; ?>" alt="<?php echo bloginfo('description'); ?>" /></a>
    } ?>

    What am I doing wrong?

    • This topic was modified 8 years, 1 month ago by edgarl.
Viewing 1 replies (of 1 total)
  • Hi edgarl,

    Have you tried the code without an array to check the condional is working?

    if( is_page( 1816 ));

    Also are you sure there is a page with ID 1816?

    Kind regards,
    Drew

Viewing 1 replies (of 1 total)
  • The topic ‘Custom logo per page (what’s wrong?)’ is closed to new replies.