Skip to content

Instantly share code, notes, and snippets.

@kylewest
Created December 21, 2016 16:39
Show Gist options
  • Save kylewest/f98fb9a989c468b51a24fd8a405202c4 to your computer and use it in GitHub Desktop.
Save kylewest/f98fb9a989c468b51a24fd8a405202c4 to your computer and use it in GitHub Desktop.
displays a custom message when url matches the regex in code.
<!-- put this code in custom html <head> section (Website Configuration) -->
<script type="text/javascript">
$(document).ready(function(){
if ( /b\-11854/i.test(window.location.href ) ) {
$("#allbrands").before("<div style='background:#FFF;text-align:center'><h2>We can get any Mazda parts.</h2><h2>Please <a href='/contact'>CONTACT US</a> if you don't see the parts that you need.</h2></div>");
}
});
</script>
@kylewest
Copy link
Author

screenshot-2016-12-21-at-11-37-08

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment