Skip to:
Content
Pages
Categories
Search
Top
Bottom

Including jQuery causes some BuddyPress functionality to stop working

  • Avatar of Henry
    Henry
    Participant

    @henrywright-1

    I need to include jQuery so that Bootstrap’s JavaScript functions work. I can do this easily in the <head> section of header.php like so:

    <script src="//code.jquery.com/jquery.js"></script>

    The problem is, when I do this some functionality in BuddyPress stops working. A good example is the cropping feature when a member is attempting to change their avatar.

    Hoping someone can suggest how to resolve this problem?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Avatar of Hugo
    Hugo
    Moderator

    @hnla

    Question is why on earth are you using bootstrap!

    Second question is isn’t jquery enqueued anyway!

    Avatar of Henry
    Henry
    Participant

    @henrywright-1

    Hey @hugo

    1. Lol! I’m lazy and a really bad designer!

    2. You just answered my question with this! jQuery is enqueued but I seem to need the latest version. Not sure including jQuery twice done me any favours. Just used wp_dequeue_script( 'jquery' ); which solved my problem.

    Thanks Hugo :)

    Avatar of cambridge15
    cambridge15
    Participant

    @cambridge15

    @henrywright-1 where did you use that? I think i’m having some of the same issues. Thanks for any help!!!

    Avatar of elaine ossipov
    elaine ossipov
    Participant

    @eossipov

    This is more than likely due to the function which is (for instance) clipping your images needs an older version of jquery.

    When you placed the bootstrap (v3?) and included the jquery in the statement then it over-rides that which is included in the image crop function.

    try including versions jquery, and you might want to also include googles jquery and then test.
    ie.
    include path/jquery.1.1.min etc
    Please let me know if this was the issue.

    Specifically add this one first, and then lets see if your problem quits:

    (‘jquery’, ‘http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js’);

    Avatar of Henry
    Henry
    Participant

    @henrywright-1

    @cambridge15 wp_dequeue_script( 'jquery' ); goes into your theme’s functions.php file but you need a bit more for it to work:

    function my_dequeue_jquery() {
         wp_dequeue_script( 'jquery' );
    }
    add_action( 'wp_footer', 'my_dequeue_jquery', 11 );
    Avatar of Henry
    Henry
    Participant

    @henrywright-1

    @eossipov thanks for the help. My problem was resolved with the code I just posted. Just had to dequeue jQuery and use Google’s latest copy instead.

    Avatar of elaine ossipov
    elaine ossipov
    Participant

    @eossipov

    You should be able to just add googles
    wp_enque(the version I posted)

    And they should work together.

    Avatar of Henry
    Henry
    Participant

    @henrywright-1

    @eossipov I think the jQuery being enqueued was v1.10? I’m using BP 1.8.1 and WP 3.6.1

    Avatar of cambridge15
    cambridge15
    Participant

    @cambridge15

    Hmm didn’t seem to work for me, maybe i’m still calling jquery somewhere and not realizing it?
    thanks for posting Henry!

    Avatar of Henry
    Henry
    Participant

    @henrywright-1

    @cambridge15 Run your website through http://tools.pingdom.com to see which resources are being loaded. That should show you which scripts you need to focus on.

Viewing 10 replies - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.