• Resolved bsierch

    (@bsierch)


    Currently using the Lensa Theme and I want to be able to change the logo for just a few select pages on my site
    not sure the correct way to go about this, this is the logo section of the header.php file – not sure how to adjust this code to produce the desired result though
    any suggestions appreciated, thanks

    <h1 class="logo">
    	  <a>">
    			<?php
    			if (get_option('colabs_logotitle')=='logo'){
    				echo '<img src="' . get_option('colabs_logo') . '" alt="' . $site_title . '" />';
    			}else {
    				echo $site_title;
    			} // End IF Statement
    			?>
      		</a>
    	  </h1>
Viewing 3 replies - 1 through 3 (of 3 total)
  • bernbe01

    (@bernbe01)

    hey there

    using some examples from this post you could build per page /post exclusions for your logo. it would look something like this:

    <?php
    if (get_option('colabs_logotitle')=='logo'){
    	if (is_page('page-title-slug-here')) {
    		echo '<img src="/path/to/alt/logo.png" alt="' . $site_title . '" />';
    	} elseif (is_page('page-title-slug-here-2')) {
    		echo '<img src="/path/to/alt/logo2.png" alt="' . $site_title . '" />';
    	} else {
    		echo '<img src="' . get_option('colabs_logo') . '" alt="' . $site_title . '" />';
    	}
    }else {
    echo $site_title;
    } // End IF Statement
    ?>

    make sure to change out the “page-title-slug-here” parts to page the pages you want an alt logo on

    make sure to change the “/path/to/alt/logo.png” to the real logo path

    also, if you are not already doing so, it highly recommended to make these changes in a child theme as that will allow you to safely continue toget theme updates without overwriting your changes. there are even plugins to help make child themes out there

    Thread Starter bsierch

    (@bsierch)

    bernbe01 – Thanks, this worked perfect! I appreciate the quick response

    bernbe01

    (@bernbe01)

    nice! i’m glad to hear it! thanks for updating the thread!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Lensa- Different Logo on certain pages’ is closed to new replies.