Skip to:
Content
Pages
Categories
Search
Top
Bottom

Including jQuery causes some BuddyPress functionality to stop working

  • @henrywright-1

    Member

    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)
  • @hnla

    Participant

    Question is why on earth are you using bootstrap!

    Second question is isn’t jquery enqueued anyway!

    @henrywright-1

    Member

    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 🙂

    @cambridge15

    Participant

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

    @eossipov

    Participant

    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&#8217;);

    @henrywright-1

    Member

    @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 );

    @henrywright-1

    Member

    @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.

    @eossipov

    Participant

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

    And they should work together.

    @henrywright-1

    Member

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

    @cambridge15

    Participant

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

    @henrywright-1

    Member

    @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)
  • The topic ‘Including jQuery causes some BuddyPress functionality to stop working’ is closed to new replies.
Skip to toolbar