-
Notifications
You must be signed in to change notification settings - Fork 0
Loading Modernizr In The Footer
Jim Reevior edited this page Aug 14, 2018
·
1 revision
By default, Modernizr is loaded in the site's <head>
tag. This is for a few
reasons.
- the
html5shiv
which is required for using HTML5 elements in <= IE8 must be executed before IE finds one of those tags in the HTML. - Any styling hooks you have based on Modernizr's classes may cause a FOUC if Modernizr is executed lazily.
More info can be found on the Modernizr repo.
If there is a valid reason to load Modernizr in the footer and you have checked for all of the scenarios described in the link above, you can tell Modernizr to load in the footer of the site.
<?php
/**
* Load Modernizr in the footer.
*/
function mytheme_r_modernizr_in_footer() {
return true;
}
add_filter( 'r_modernizr_in_footer', 'mytheme_r_modernizr_in_footer' );
Get started
Configuration
Build child themes
- Customizing CSS in a child theme
- Overriding templates in a child theme
- Code patterns
- Code reviews
- Pulling in Foundation Updates
- Merging and Creating a Pull Request
Sass
Javascript
PHP
- Coding Standards
- PHP Constants
- Temp PHP Code Patterns
- PHP Snippets
- How to Use Hooks
- Action Hooks
- Using Action Hooks To Output Markup
- Filter Hooks
Shortcodes
Templates
GitHub
Tasks
Contribute to the framework
- Framework Development and Release Workflows
- Documentation Template
- Testing your changes
- Creating a new release
- Migration Guide
- Needs Documentation
Code Examples
- Adding Content Container Classes
- Adding News Templates
- Adding Script Dependencies
- Changing Available Layouts and Default Layout
- Displaying a Fancy Gallery
- Loading a Custom Build of Modernizr
- Loading Modernizr in the Footer
- Using Action Hooks To Output Markup
- Understanding get_template_part
BU Developer Resources