Created
November 28, 2013 09:27
-
-
Save webaware/7689334 to your computer and use it in GitHub Desktop.
quick WordPress snippet for showing what classes have been added to the HTML and BODY elements -- useful for seeing what a tablet or phone gets without messing around with debuggers.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('wp_print_footer_scripts', function() { | |
?> | |
<script> | |
(function() { | |
var p = document.createElement("p"); | |
p.appendChild(document.createTextNode("html classes: " + document.documentElement.className)); | |
document.body.appendChild(p); | |
p = document.createElement("p"); | |
p.appendChild(document.createTextNode("body classes: " + document.body.className)); | |
document.body.appendChild(p); | |
})(); | |
</script> | |
<?php | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment