Ordering stylesheet and JavaScript (external and inline) for performance optimization.
order-styles-js.php to the /wp-content/plugins/ directory<head>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<?php
// 1. After Head start section
if (function_exists('orderStyleJS')) {
orderStyleJS( 'start' );
}
?>
<!-- blah blah - any other meta element. Stylesheet - External JavaScript - Internal Js -->
<!-- blah blah - any other meta element. Stylesheet - External JavaScript - Internal Js -->
<?php
// 2. Just before Head close section
if (function_exists('orderStyleJS')) {
orderStyleJS( 'end' );
}
?>
</head>
Requires: 2.0.2 or higher
Compatible up to: 3.1.4
Last Updated: 2010-8-13
Downloads: 2,617
Got something to say? Need help?