jquery - Is there a way to move WPML scripts in footer?

I found out that wpml force my jquery to load into header. (I already deregistered it and registered my own one).Is ther

I found out that wpml force my jquery to load into header. (I already deregistered it and registered my own one).

Is there a way to move wpml script in footer?

I found out that wpml force my jquery to load into header. (I already deregistered it and registered my own one).

Is there a way to move wpml script in footer?

Share Improve this question asked Nov 4, 2016 at 9:38 MarcoMarco 1134 bronze badges 3
  • wpml/forums/topic/how-to-load-wpml-scripts-in-footer – Rishabh Commented Nov 4, 2016 at 9:47
  • first result on google, already read. I asked here because maybe I need more infos or maybe I'd like to find different approach? – Marco Commented Nov 4, 2016 at 9:59
  • Yep! I deregister jquery, register it again with footer option 'true', but when I activate wpml main plugin, it forces jquery (and jquery ui) in the header. I'm going to search for wpml register script function, get scripts handles, deregister them in my theme and register them again with footer option. – Marco Commented Nov 4, 2016 at 17:18
Add a comment  | 

1 Answer 1

Reset to default 0

It depends. As commented on OP, WPML documentation and support are very minimal on this front.

I found that for me, the only culprit forcing jQuery to the head of the HTML was wpml-xdomain-data.js from sitepress-multilingual-cms/classes/url-handling/class-wpml-xdomain-data-parser.php:53. This script appears to handle some part of the language switchers and, as I have a custom language switcher, I could deregister this script without loss of functionality:

wp_deregister_script('wpml-xdomain-data');

In functions.php through wp_enqueue_scripts hook.

Also see: https://wpml/forums/topic/how-to-load-browser-redirect-js-and-jquery-cookie-js-in-the-footer/

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744789008a4593800.html

相关推荐

  • jquery - Is there a way to move WPML scripts in footer?

    I found out that wpml force my jquery to load into header. (I already deregistered it and registered my own one).Is ther

    10小时前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信