Skip to content
/ soil Public
forked from roots/soil

A WordPress plugin which contains a collection of modules to apply theme-agnostic front-end modifications

License

Notifications You must be signed in to change notification settings

ck1981/soil

Repository files navigation

Soil

Build Status

Clean up WordPress markup, use relative URLs, nicer search URLs, and disable trackbacks

Installation

If you're using Composer to manage WordPress, add Soil to your project's dependencies. Run:

composer require roots/soil 3.1.0

Or manually add it to your composer.json:

"require": {
  "php": ">=5.3.0",
  "wordpress": "4.1.1",
  "roots/soil": "3.1.0"
}

Features

Clean-up

Enable Soil's clean-up with:

add_theme_support('soil-clean-up');
  • wp_head() clean up
  • Remove WP version from RSS feeds
  • Clean up <html> attributes
  • Clean up <link> and <script> tags
  • Clean up body_class()
  • Wrap embedded media as suggested by Readability
  • Remove unnecessary dashboard widgets
  • Remove unnecessary self-closing tags

Relative URLs

Enable Soil's root relative URLs with:

add_theme_support('soil-relative-urls');

Nice search

Enable Soil's nice search (/search/query/) with:

add_theme_support('soil-nice-search');

Google Analytics

Enable HTML5 Boilerplate's Google Analytics snippet

add_theme_support('soil-google-analytics', 'UA-XXXXX-Y');

By default, the script will be loaded from the wp_footer hook, but you can specify any other action hook as the third parameter.

add_theme_support('soil-google-analytics', 'UA-XXXXX-Y', 'wp_head'); // script will load during wp_head

Dummy ga() Function

This module will load a dummy ga() function for non-administrators as well as in non-production environments (when WP_ENV is defined). The function takes all arguments passed to it and logs them to the JavaScript console.

You can override whether the dummy function is displayed via the soil/dummyGA filter.

add_filter('soil/dummyGA', '__return_true');  // Appends a dummy `ga()` function
add_filter('soil/dummyGA', '__return_false'); // Appends H5BP's GA snippet

JS to Footer

Move all scripts to wp_footer action hook with:

add_theme_support('soil-js-to-footer');

Disable trackbacks/pingbacks

Remove trackback/pingback functionality with:

add_theme_support('soil-disable-trackbacks');

Disable asset versioning

Disable ver query string from all styles and scripts with:

add_theme_support('soil-disable-asset-versioning');

Support

Use the Roots Discourse to ask questions and get support.

About

A WordPress plugin which contains a collection of modules to apply theme-agnostic front-end modifications

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%