Search Results for 'dequeue'

Home Forums Search Search Results for 'dequeue'

Viewing 4 results - 271 through 274 (of 274 total)
  • Author
    Search Results
  • #31838
    Jonah
    Participant

    Hi Patrick,

    To accomplish this, make a copy of /wp-content/plugins/the-events-calendar/resources/events.js and place in an ‘events’ folder in your theme. Then, open it up and comment out lines 14-19 which is the code for the tooltips in the big calendar. Then, add this to your themes functions.php file:

    /*-------------------------------------------------------------------------------
    Add Custom events.js
    -------------------------------------------------------------------------------*/
    function example_enqueue_scripts() {
    wp_dequeue_script('tribe-events-calendar-script');
    wp_register_script('custom-events-calendar-script', get_template_directory_uri().'/js/events.js'); // notice it's not the same script name as the original one, that's important - otherwise it re-enqueues the old version
    wp_enqueue_script('custom-events-calendar-script');
    }
    add_action('wp_enqueue_scripts', 'example_enqueue_scripts');

    That will remove the core events.js and load yours instead.

    Please keep in mind that you will then be running your own modified copy of events.js and if we publish any updates to the plugin, you will need to manually merge those in to yuor customized version.

    I hope this helps!

    – Jonah

    #29228
    Barry
    Member

    Hi Leonard: I visited your site again and the version if jQuery in use is still 1.6.4 – and the error I can see in the console is consistent with the problem I detailed here.

    So it’s likely that you’ve missed a bit of code somewhere which removes the shipped version of jQuery and replaces it with this one. The URL suggests it is your theme that is responsible for this:

    http://www.verdugohillshospital.org/wp-content/themes/vhh/js/jquery-1.6.4.min.js

    (Noting the copy of jQuery is found within themes/vhh)

    What you are looking for is likely to be a wp_dequeue_script() call immediately followed by a wp_enqueue_script() call – however I can’t really help you with finding that. If your developer has moved on and you can’t locate this then I’d have to recommend that you hire a new developer or designer for this task, it shouldn’t take someone with experience and the right tools very long at all to find the code in question.

    What I don’t know of course is if there might be side-effects – perhaps that older version of jQuery is required for a reason (such as making the slider work) … again if so you will probably need assistance in working through this.

    Jonah
    Participant

    Hi Christian,

    This should get you on your way:

    function remove_styles() {
    if( tribe_is_month() && !is_tax() ) { // The Main Calendar Page
    //wp_dequeue_style( 'tribe_events-admin-ui' );
    wp_dequeue_style( 'tribe-events-mini-calendar' );
    wp_dequeue_style( 'tribe-events-calendar-style' );
    }
    }
    add_action('wp_print_styles','remove_styles',1);

    function remove_scripts() {
    if( tribe_is_month() && !is_tax() ) { // The Main Calendar Page
    wp_dequeue_script( 'tribe-events-calendar-script' );
    wp_dequeue_script( 'tribe-events-pjax' );
    wp_dequeue_script( 'tribe-events-mini-calendar' );
    wp_dequeue_script( 'jquery-ecp-plugins' );
    wp_dequeue_script( 'chosen-jquery' );
    wp_dequeue_script( 'tribe_events-admin' );
    }
    }
    add_action('wp_print_scripts','remove_scripts',1);

    Put that in your theme’s functions.php file and add/remove whatever you want/don’t want. You can also use these conditional wrappers to further customize this: https://gist.github.com/2415009

    I hope that helps!

    – Jonah

    #21413
    Jonah
    Participant

    Hi Mark,

    Try adding this to your theme’s functions.php file:

    function remove_styles() {
    if(!is_admin()) {
    wp_dequeue_style( 'tribe_events-admin-ui' );
    }
    }
    add_action('wp_print_styles','remove_styles',1);

Viewing 4 results - 271 through 274 (of 274 total)