Author:

The Developer’s Guide To Conflict-Free JavaScript And CSS In WordPress

Imagine you’re playing the latest hash-tag game on Twitter when you see this friendly tweet: "You might want to check your #WP site. It includes two copies of jQuery. Nothing’s broken, but loading time will be slower."

sm-wp-css-js

You check your source code, and sure enough you see this:

<script src="/wp-includes/js/jquery/jquery.js?ver=1.6.1" type="text/javascript"></script>
<script src="/wp-content/plugins/some-plugin/jquery.js"></script>

What went wrong? The first copy of jQuery is included the WordPress way, while some-plugin includes jQuery as you would on a static HTML page. A number of JavaScript frameworks are included in WordPress by default.

Read more...

↑ Back to top