jquery compatibility

Home Forums Calendar Products Events Calendar PRO jquery compatibility

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #963784
    Mark
    Participant

    Hi there,

    I’ve noticed that placing the following link in my header yields part of The Events Calendar not to work (e.g. Previous events button):
    http://code.jquery.com/jquery-latest.min.js

    So I’m just wondering which version of jquery is compatible with The Events Calendar – as I need it to use Fancybox within the website (if possible).

    Thank you for any help.

    #963990
    George
    Participant

    Hey Mark,

    The version of jQuery itself might not be to blame for your problems here – it could simply be because of there being more than one version of jQuery loaded onto the page, which can cause issues.

    This is probably being loaded by your theme, and seems like it’s hard-coded into your theme. https://cloudup.com/cB5bPc6kTqo

    This can cause problems is bad practice for WordPress sites – try to find this code in your theme and remove it, and just WordPress load its own jQuery library.

    There’s also broken HTML related to this in the <head> of your pages, it looks like this:

    
    <!--	<!-- Add jQuery library --*>
    

    That’s an invalid HTML comment, it should at least look something along the lines of this:

    
    <!-- Add jQuery library -->
    

    Try to make these changes and see if anything improves – let us know!

    Thanks,
    George

    #965938
    Mark
    Participant

    This reply is private.

    #966225
    George
    Participant

    Hi Mark,

    To detect if you’re on an Events Category page, you can use the function tribe_is_event_category(). This is defined in /template-tags/query.php if you’d like to learn more about it. For now, however, I’d like to turn our attention back to the jQuery issue.

    Your language about Fancybox and jQuery was revealing of something that I think might be part of the problem here. You said:

    I’ve also tried using Fancybox with and without loading the jQuery library in the header – but it seems that Fancybox won’t work without it, and The Event Calendar (previous events button) won’t work with it.

    jQuery is needed for Fancybox, for Events Calendar, and many other scripts on your page. The problem is not jQuery itself, but likely your attempts at trying to load it a certain way yourself. Do not try to load it yourself in the header or something like that – remove any custom code you have done related to loading jQuery. WordPress itself should be loading jQuery fine as needed, and if not, then we can work through the specific problems from there one by one.

    But first: remove all custom code you’ve added anywhere in your theme to try and load jQuery yourself. Then, let us know how things are working – if there are still issues, share a link with us directly to the page on your site where you notice issues, and we’ll take a closer look.

    Thank you for your patience with the issue, all we should need to do is get jQuery loading correctly which is fortunately usually a fairly straightforward thing to do.

    Thanks!
    George

    #966254
    Mark
    Participant

    This reply is private.

    #966512
    Mark
    Participant

    Hi George,

    Is it possible to do something like this – as it doesn’t appear to work:

    <?php if ( tribe_is_event_category (‘deloitte-entrepreneur-series’) ) {
    echo ‘deloitte-entrepreneur-series’;

    } elseif ( tribe_is_event_category (‘stanford-australia-association’) ) {
    echo ‘stanford-australia-association’;

    } else {
    echo ‘no category’;
    }
    ?>

    Many thanks for your help.

    #966534
    George
    Participant

    Hi Mark,

    To answer your questions in reverse order: if you use the has_term() WordPress function and specify tribe_events_cat for the $taxonomy argument, you should be able to do basically exactly what you describe wanting to do. Though we will not be able to offer specific support for using this function, there’s fortunately great documentation for it here where you can ;earn more about it → https://codex.wordpress.org/Function_Reference/has_term

    As for your Fancybox-related question, there is little insight we can offer here since it’s not a question related specifically to one of our own plugins. But from what I can tell, the basics here seem to be that your theme (or another plugin on your site, but it’s most likely your theme) is loading scripts incorrectly. Your best bet is to go through your theme (or hire someone to do so) and ensure two things:
    1. That jQuery is being loaded on your site correctly, not hard-coded into the header or anywhere else on your site but just being called by wp_enqueue_script(), and
    2. That all your other scripts that depend on jQuery are also being called correctly with wp_enqueue_script(), with jQuery as a dependency.

    I hope these two blocks of information help.

    Cheers!
    George

    #966792
    Mark
    Participant

    This reply is private.

    #967071
    George
    Participant

    Hey Mark,

    has_term() should work here as long as the tribe_events_cat slug is accurate and you’re within the context of an event or event loop.

    Adding an ID to the $post parameter can help, e.g. instead of just this:

    
    if ( has_term ( 'deloitte-entrepreneur-series', 'tribe_events_cat' ) )
    

    You use this:

    
    if ( has_term ( 'deloitte-entrepreneur-series', 'tribe_events_cat', get_the_ID() ) )
    

    If you’re not having luck with this function, there’s a myriad amount of alternatives you can use. Look for _term functions within WordPress, for example. An example of this is to use wp_get_object_terms() to get the tribe_events_cat items attached to an event, then manually check with in_array() for the term you’re looking for.

    I’m sorry about the limitations with our support for customizations, but hopefully this information is helpful. If you haven’t read that has_term() article on the WordPress Codex that I linked to, I encourage you to! Lots of great info there, and lots of great tutorials online as well.

    Hopefully between all of these things you’re able to patch something together.

    Cheers!
    George

    #984240
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘jquery compatibility’ is closed to new replies.