Skip to content

Instantly share code, notes, and snippets.

@KatieMFritz
Last active December 12, 2019 11:40
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save KatieMFritz/02808d01203e2d566d98689b5315b8d8 to your computer and use it in GitHub Desktop.
Save KatieMFritz/02808d01203e2d566d98689b5315b8d8 to your computer and use it in GitHub Desktop.

Check the following boxes in the Control Panel Body Classes settings:

  1. Include a class to denote the current page?
  2. Include a class to denote the entries site?
/* color the safs site background and make the text white */
body[class*="safs"] #header,
body[class*="safs"] #crumbs,
body[class*="safs"] #crumbs a,
body[class*="safs"] #crumbs li::after {
background-color: #008183 !important;
color: #fff !important;
}
/* color the effs site background and make the text white */
body[class*="effs"] #header,
body[class*="effs"] #crumbs
body[class*="effs"] #crumbs a,
body[class*="effs"] crumbs li:after {
background-color: #cb5a28 !important;
color: #fff !important;
}
/* change the effs submit button color */
body[class*="effs"] #header .submit {
background-image: -webkit-gradient(linear, left top, left bottom, from(#c89a58), to(#927040));
background-image: linear-gradient(#c89a58, #927040);
}
var header = document.getElementById('header')
// assign variables for each site
var site1Handle = 'Sustainable Agriculture and Food Systems Minor'
var site2Handle = 'Graduate Specialization'
var site1Class = 'entriessite-safs'
var site2Class = 'entriessite-effs'
// based on the current site selected in the dropdown menu, toggle classes
if ( header.innerHTML.toString().indexOf(site1Handle + '</div>') > -1 ) {
document.body.classList.add(site1Class)
document.body.classList.remove(site2Class)
}
if ( header.innerHTML.toString().indexOf(site2Handle + '</div>') > -1 ) {
document.body.classList.add(site2Class)
document.body.classList.remove(site1Class)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment