Snippet: How to Add jQuery 1.5 to WordPress

jQuery 1.5 was released recently with plenty of bug fix and new effect. For those who wanted to make use of jQuery 1.5 in WordPress, here is how you can do it:

Open your functions.php file and copy and paste the following code.

if(!is_admin()){
wp_deregister_script('jquery');
wp_register_script('jquery', ("http://code.jquery.com/jquery-1.5.min.js"), false, '1.5');

Now, any theme/plugin that call the wp_enqueue_script('jquery') functions will return the path to the jQuery 1.5 script. Continue reading

Limit The jQuery Lazy Load Plugin to Operate Only In The Content Area

lazy-dazyIf you have noticed, one of the way that highly-trafficked site save bandwidths is to use a lazy load plugin. What this lazy load plugin does is to load the images only when they become visible on the screen. Any images below the visible screen will not be displayed. This is also known as on-demand loading.

In WordPress, there are several lazy load plugins that you can use. One of my favorite is the jQuery Image Lazy Load plugin, simply because it just works the moment you activate it. No configuration is required.
Continue reading