Conditionally Replace Logo with Alt Logo
-
Hi there I’m trying to replace the default black logo with a white alternative with js. Below is the snippet that used to work until recent wordpress updates… Please help!
This link should show a white logo not black like the menu color (white)
jQuery(document).ready(function($){ //replace black logo with white logo // full urls in between the ticks var logodefault = 'https://sscreativestudio.com/wp-content/uploads/2015/11/logo.png', logowhite = 'https://sscreativestudio.com/wp-content/uploads/2015/11/logo-white.png'; if ($('body').hasClass('label-white-header')) { $('img[src="' + logodefault + '"]').attr('src', logowhite); } } else { //default logo $('img[src="' + logowhite + '"]').attr('src', logodefault); } //end if label white header
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Conditionally Replace Logo with Alt Logo’ is closed to new replies.