|
| 1 | +# Genesis js / no-js |
| 2 | + |
| 3 | +Make front-end styling easier for child themes on the Genesis Framework based on whether JavaScript is enabled or not. |
| 4 | + |
| 5 | +## Description |
| 6 | + |
| 7 | +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 `body` tag is a small script which replaces `no-js` with `js` (you can see the amended class with Firebug / Inspector). |
| 8 | + |
| 9 | +WordPress uses this to apply different styles to the same elements, depending on whether JavaScript is present or not. |
| 10 | + |
| 11 | +This plugin recreates the same effect, but for the front-end of <a href="http://genesis-theme-framework.com/">Genesis Framework</a> child themes. It uses the `genesis_before` hook supplied by Genesis, so it won't work for other themes. |
| 12 | + |
| 13 | +The script is fairly small so does not block rendering of other content for any noticeable length of time. |
| 14 | + |
| 15 | +Putting the script at the top also reduces a flash of incorrectly styled content, as the page does not load with `no-js` styles, then switch to `js` once everything has finished loading. |
| 16 | + |
| 17 | +## Installation |
| 18 | + |
| 19 | +Once this plugin is installed and activated, then it will work automatically. There are no options, and nothing to set-up. |
| 20 | + |
| 21 | +### Upload |
| 22 | + |
| 23 | +1. Download the latest tagged archive (choose the "zip" option). |
| 24 | +2. Go to the __Plugins -> Add New__ screen and click the __Upload__ tab. |
| 25 | +3. Upload the zipped archive directly. |
| 26 | +4. Go to the Plugins screen and click __Activate__. |
| 27 | + |
| 28 | +### Manual |
| 29 | + |
| 30 | +1. Download the latest tagged archive (choose the "zip" option). |
| 31 | +2. Unzip the archive. |
| 32 | +3. Copy the folder to your `/wp-content/plugins/` directory. |
| 33 | +4. Go to the Plugins screen and click __Activate__. |
| 34 | + |
| 35 | +Check out the Codex for more information about [installing plugins manually](http://codex.wordpress.org/Managing_Plugins#Manual_Plugin_Installation). |
| 36 | + |
| 37 | +### Git |
| 38 | + |
| 39 | +Using git, browse to your `/wp-content/plugins/` directory and clone this repository: |
| 40 | + |
| 41 | +`git clone git@github.com:GaryJones/genesis-js-no-js.git` |
| 42 | + |
| 43 | +Then go to your Plugins screen and click __Activate__. |
| 44 | + |
| 45 | +## Updates |
| 46 | + |
| 47 | +This plugin supports the [GitHub Updater](https://github.com/afragen/github-updater) plugin, so if you install that, this plugin becomes automatically updateable direct from GitHub. |
| 48 | + |
| 49 | +## Credits |
| 50 | + |
| 51 | +Built by [Gary Jones](https://twitter.com/GaryJ) |
| 52 | +Copyright 2011 [Gamajo Tech](http://gamajo.com/) |
0 commit comments