WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Performance Optimization: Order Styles and Javascript

Ordering StyleSheet and JavaScript (external and inline) for performance optimization.

  1. Donwload the plugin from WordPress Plugin Directory (http://wordpress.org/extend/plugins/)
  2. Upload order-styles-js.php to the /wp-content/plugins/ directory
  3. Active the plugin
  4. Add the following lines of codes at header.php file where you see <head> section. You need to add only PHP lines given below. HTML code is for demonstration purpose only. Mime type "UTF-8" is my mime type. Mention your mime type meta tag. It will just there cut and paste just after Head section. If "Content-Type" is not available (suppose) in your WordPress header.php file, then no worry, you can add the 1st part just after <head>.

<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.6.1
Last Updated: 2013-10-11
Downloads: 5,513

Ratings

4 stars
4.1 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1 100,1,1
100,1,1 100,1,1
100,1,1
100,2,2
0,1,0
100,3,3
100,1,1