Created
June 17, 2016 09:02
-
-
Save samikeijonen/3fd0b2e7e77a393ab9c8292c7eaea344 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| /** | |
| * Handles JavaScript detection. | |
| * | |
| * Adds a `js` class to the root `<html>` element when JavaScript is detected. | |
| * | |
| * @since Twenty Sixteen 1.0 | |
| */ | |
| function twentysixteen_javascript_detection() { | |
| echo "<script>(function(html){html.className = html.className.replace(/\bno-js\b/,'js')})(document.documentElement);</script>\n"; | |
| } | |
| add_action( 'wp_head', 'twentysixteen_javascript_detection', 0 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment