Okay
  Public Ticket #179709
Custom Menu Logo for different pages
Closed

Comments

  • Jonathan started the conversation

    I have a website for Upper Room Dallas and Upper Room Denver. They have a different menu based on which half of the website you are on, however, I want to have a different logo in the nav menu dependent on the page. I noticed a similar question earlier where code was provided (see http://themenectar.ticksy.com/ticket/121539/search...

    I added this code to my header.php and it just wipes out the whole website. Can you tell me in laymens terms where to place it and what to edit?

    Thank you!

  •  1,069
    ThemeNectar replied

    Hey Jonathan!

    The code in the ticket you linked was kind of pseudo-code, but here's actual code you could place:

    <?php 
    if( is_page('My Page') ){
      echo '<a id="logo" href="custom-client-link"> <img src="custom-client-logo.jpg" /> </a>';
    } else {
      echo '<a id="logo" href="<?php echo home_url(); ?>"> <img src="default-logo.jpg" /> </a>';
    }
    ?>
    

    and it would replace this section in the file:

     
    <a id="logo" href="<?php echo home_url(); ?>" <?php echo $logo_class; ?>>
    						
    	<?php if(!empty($options['use-logo'])) {
    							
    		$default_logo_id = (!empty($options['retina-logo'])) ? 'id="default-logo"' : null;
    
    		 echo '<img '.$default_logo_id.' alt="'. get_bloginfo('name') .'" src="' . $options['logo'] . '" />';
    							 
    		 if(!empty($options['retina-logo'])) echo '<img id="retina-logo" alt="'. get_bloginfo('name') .'" src="' . $options['retina-logo'] . '" />';
    							 
    		 } else { echo get_bloginfo('name'); } ?> 
    </a>
    

    Cheers :)

  • Jonathan replied

    Got it, thanks!!