Conflict with wordpress jquery.js

Discussion in 'aMember Pro v.4' started by bennyuk1, Jan 26, 2012.

  1. bennyuk1

    bennyuk1 aMember Pro Customer

    Joined:
    Jan 12, 2012
    Messages:
    200
    I've noticed that when amember is used within wordpress theme, the jquery.js that is loaded by AM (jQuery v1.6.4) conflicts somehow with the jquery.js loaded by wordpress (jQuery v1.7.1).

    The result is someof the wordpress features do not work.

    Is there a way to check and avoid conflicts like this?

    I tried removing jquery.js in the am folder, (relying just on the wp jquery) but this breaks the admin section of AM. (edit: I'm not sure if this does actually break am admin, more tests needed)
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Try to edit /ameber/application/default/plugins/protect/wordpress/default/layout.html and change this line:
    PHP:
    Am_Di::getInstance()->plugins_protect->get('wordpress')->startLayout($this$title);
    to
    PHP:
    Am_Di::getInstance()->plugins_protect->get('wordpress')->startLayout($this$titletrue);
    Let me know if this does not help.
  3. bennyuk1

    bennyuk1 aMember Pro Customer

    Joined:
    Jan 12, 2012
    Messages:
    200
    Fantastic, that worked perfectly, many thanks.
  4. nobwaart

    nobwaart New Member

    Joined:
    Jan 20, 2012
    Messages:
    20
    Thanks Alexander, I am using the PageLines Framework and when aMember plug-in was enabled it was causing a conflict, but with that one simply line change, it looks back to it's normal self!
  5. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Ok. I will add this to plugin release then.
  6. nobwaart

    nobwaart New Member

    Joined:
    Jan 20, 2012
    Messages:
    20
    Hmmm... At first I thought your suggestion above worked. However, this was to be the case, there is still unfortunately a conflict which is cause by the plug-in. If I de-activate the plug-in the PageLines settings return to how they should.

    If you like I can send you the PageLines Framework so you can take a look for yourself?
  7. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Can I check this on your site?
    Contact me in helpdesk please
  8. jennifer_davis

    jennifer_davis New Member

    Joined:
    Jun 23, 2012
    Messages:
    17
    We have a similar problem. My client's site is in WordPress and jQuery is loaded in the WordPress functions file, version http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js. There is a jQuery image carousel in the header of the website. On the aMember Pro Password Change form, which uses jQuery, and on that particular page, the image carousel doesn't work. I am not a jQuery guru and do not know how to resolve this conflict.
  9. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Do you use aMember CP -> Setup -> Wordpress -> use wordpress theme? Or did you change amember template to look like wordpress one? In first case aMember use safe jquery load(it will check was it loaded before and will load it only if there is no jQuery object) so all plugins should work. If you modified aMember template files directly, a little tweak to layout.phtml will be required.

Share This Page