XF 2.0 2nd version of jQuery needed for custom header

RK_M

Member
Would appreciate any thoughts from those experienced with jQuery. I've got this working locally with no js errors but want to make sure the approach is sound.

I need to use a custom header with xenForo that mimics my Wordpress/Divi header. Since WP uses an older version (1.x) of jQuery, I get javascript errors if I just point the WP header to the jQuery v3.x loaded by Xenforo.

To get this working, I've done the following:
  • In the XF helper_js_global template, added a reference to the jQuery 1.12.4 file, followed immediately by the following script (per top answer in this SO post):
  • Code:
    <script> jq1124 = jQuery.noConflict(true); </script>
  • Also in the XF helper_js_global template, added a reference to the custom javascript file that the WP header needs. It calls the "jq1124" file loaded above.
Does this sound like an OK approach? XenForo seems to be getting along just fine with this, but I haven't tested every forum use case. :)
 
Back
Top Bottom