no-js body class to the front-end, and a script on
genesis_before which immediately changes the class to
This plugin is only useful if you’re using a child theme of the Genesis Framework since it uses the
- What does this plugin actually do?
If you look at the source of a WordPress back-end page, you’ll see it has a body class of
no-js. Immediately after the opening
bodytag is a small script which replaces
js(you can see the amended class with Firebug / Inspector).
This plugin recreates the same effect, but for the front-end of Genesis Framework child themes.
- Shouldn’t the script be at the end of the page?
Usually, yes, but it’s a fairly small script, so does not block rendering of other content for any noticeable length of time.
Doing it immediately also reduces a flash of incorrectly styled content, as the page does not load with
no-jsstyles, then switch to
jsonce everything has finished loading.
Thank you for this !
- Load plugin text domain.
- Better change log format.
- Tweak documentation.
- GitHub Updater plugin support
- Refactor class into a new file. Stops using half-implemented Singleton pattern.
- Update documentation.
- Improved plugin so script is hooked in with priority 1 – avoids a theme placing anything before the script (props Josh Stauffer)
- First public version.