All Good Things Must Come To An End

As you all know, I have been doing WordPress plugins and supporting it for the past 6 years. These 6 years of my life, I have been through my polytechnic education, my national service as well as my university education.

I just graduated from university in December 2009 and have been looking for full-time jobs. I am offered a full-time job and will be starting work on 1st February 2010.

I regret to say that I am NOT ABLE to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

However, I WILL still update my plugins whenever I can and you still can report bugs to me via email and I will try to fix it.


Author Topic: Loading Default JavaScript Libraries In Footer of WordPress?  (Read 1743 times)

0 Members and 1 Guest are viewing this topic.

Offline D.i M.e

  • Newbie
  • *
  • Posts: 4
    • View Profile
In this post you showed how to load custom JavaScript in footer, but what about default scripts, like jQuery, Prototype... ?

I tried, for example,
Code: [Select]
wp_enqueue_script('jquery', '', '', '', true); but without success.

Thanks in advance

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,536
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: Loading Default JavaScript Libraries In Footer of WordPress?
« Reply #1 on: 21 September 2009, 05:48 »
jquery cannot be loaded in the footer. It will not work.

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline D.i M.e

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Loading Default JavaScript Libraries In Footer of WordPress?
« Reply #2 on: 21 September 2009, 18:41 »
Thank you for quick answer. Why jQuery can't load in the footer? I tried other default scripts with this code but they are too loaded in header.

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,536
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: Loading Default JavaScript Libraries In Footer of WordPress?
« Reply #3 on: 21 September 2009, 19:05 »
I can't really put that into words, jQuery is important and sometimes before the footer is reached you need to do something with jQuery and hence it has to be loaded in the header.

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline D.i M.e

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Loading Default JavaScript Libraries In Footer of WordPress?
« Reply #4 on: 21 September 2009, 19:43 »
I meant, is technically impossible to load it in footer in WordPress or it is only advisable not to load in footer? (btw, Twitter loads it in footer ;) )

But how to load any of the default scripts in footer, not just jQuery?

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,536
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: Loading Default JavaScript Libraries In Footer of WordPress?
« Reply #5 on: 21 September 2009, 19:55 »
Twitter does not use any jQuery function before jQuery is loaded I think. I think they mainly use jQuery for AJAX.

You can try:
Code: [Select]
wp_enqueue_script('jquery', false, array(), false, true);
I have not tried loading any of the default script in the footer yet.

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline D.i M.e

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Loading Default JavaScript Libraries In Footer of WordPress?
« Reply #6 on: 21 September 2009, 20:18 »
Twitter does not use any jQuery function before jQuery is loaded I think. I think they mainly use jQuery for AJAX.


I too want to use it for AJAX and since that action is done by user when page is loaded, I thought to speed up page loading by moving jQuery to footer. If theme or another plugin don't have in_footer value, then jQuery would load in head and everything should work fine (at least I think that footer/header including of scripts works in WordPress).

You can try:
Code: [Select]
wp_enqueue_script('jquery', false, array(), false, true);


Unfortunately, it doesn't works. Thanks anyway.

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,536
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: Loading Default JavaScript Libraries In Footer of WordPress?
« Reply #7 on: 21 September 2009, 20:43 »
You can enqueue a new jQuery 2 object, but I guess you have to modify all the scripts that uses jquery as the dependency.
Code: [Select]
wp_enqueue_script('jquery-2', 'wp-includes/js/jquery/jquery.js', array(), '1.3.2', true);

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.