Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
Add js-to-footer module
Browse files Browse the repository at this point in the history
  • Loading branch information
QWp6t committed Mar 4, 2015
1 parent 1d677b6 commit f122c75
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ Enable Soil's nice search (`/search/query/`) with:
add_theme_support('soil-nice-search');
```

### JS to Footer

Move all scripts to `wp_footer` action hook with:

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

### Disable trackbacks/pingbacks

Remove trackback/pingback functionality with:
Expand Down
16 changes: 16 additions & 0 deletions modules/js-to-footer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace Roots\Soil\JsToFooter;

/**
* Moves all scripts to wp_footer action
*
* You can enable/disable this feature in functions.php (or lib/config.php if you're using Sage):
* add_theme_support('soil-js-to-footer');
*/
function js_to_footer() {
remove_action('wp_head', 'wp_print_scripts');
remove_action('wp_head', 'wp_print_head_scripts', 9);
remove_action('wp_head', 'wp_enqueue_scripts', 1);
}
add_action('wp_enqueue_scripts', 'js_to_footer');

0 comments on commit f122c75

Please sign in to comment.