Home › Forums › Back End › Different Logo for each wordpress page › Reply To: Different Logo for each wordpress page
September 4, 2013 at 8:36 am
#149013
sayedtaqui
Participant
Well it should be done by editing your current theme however , if you are just looking for some copy paste code then paste this in your functions.php file and replace the image sources with your.
function mms_current_page_url() {
$pageURL = 'http';
if( isset($_SERVER["HTTPS"]) ) {
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
add_action('wp_head', 'mms_change_logo_on_each_page' );
function mms_change_logo_on_each_page(){
if(mms_current_page_url() == 'http://www.creativemms.com.au/verve/'):
?>
<script>
jQuery(document).ready(function(){
jQuery('#logo a img').attr('src', 'http://www.creativemms.com.au/verve/wp-content/uploads/2013/07/verve_logo_blue.png');
})
</script>
<?php
elseif(mms_current_page_url() == 'http://www.creativemms.com.au/verve/about-us/' ):
?>
<script>
jQuery(document).ready(function(){
jQuery('#logo a img').attr('src', 'ENTER LOGO URL FOR ABOUT US');
})
</script>
<?php
elseif(mms_current_page_url() == 'http://www.creativemms.com.au/verve/services/' ):
?>
<script>
jQuery(document).ready(function(){
jQuery('#logo a img').attr('src', 'ENTER LOGO ULR FOR SERVICES');
})
</script>
<?php
elseif(mms_current_page_url() == 'http://www.creativemms.com.au/verve/work/' ):
?>
<script>
jQuery(document).ready(function(){
jQuery('#logo a img').attr('src', 'ENTER LOGO ULR FOR WORK');
})
</script>
<?php
elseif(mms_current_page_url() == 'http://www.creativemms.com.au/verve/contact-us/' ):
?>
<script>
jQuery(document).ready(function(){
jQuery('#logo a img').attr('src', 'ENTER LOGO ULR FOR CONTACT US');
})
</script>
<?php
endif;
}