wp_dequeue_style() and wp_dequeue_script().

Home Forums Calendar Products Community Events wp_dequeue_style() and wp_dequeue_script().

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1044184
    Diane
    Participant

    is there some code I can use to dequeue styles and scripts for ECP if not on events page or home page?

    #1044478
    Diane
    Participant

    i tried this and it doesn’t work…

    function dequeue_tribe_events_scripts_and_styles() {
    if ( function_exists( ‘tribe_is_event’ ) ) {
    //dequeue scripts and styles
    if ( ! is_home() && ! tribe_is_event() ) {

    wp_dequeue_style( ‘tribe-events-full-pro-calendar’ );
    wp_dequeue_style( ‘tribe-events-calendar-pro’ );
    wp_dequeue_style( ‘tribe-events-calendar-full-pro-mobile’ );
    wp_dequeue_style( ‘tribe-events-calendar-pro-mobile’ );
    wp_dequeue_style( ‘tribe_events-widget-calendar-pro’);

    wp_dequeue_script( ‘tribe-events-list’ );
    wp_dequeue_script( ‘tribe-events-pro’ ); // relies on tribe-events-calendar-script
    wp_dequeue_script( ‘tribe-events-pro-geoloc’ );
    wp_dequeue_script( ‘tribe-placeholder’ );
    wp_dequeue_script( ‘tribe-events-jquery-resize’ );
    wp_dequeue_script( ‘tribe-events-bar’ ); // relies on placeholder, resize, datepicker
    wp_dequeue_script( ‘tribe-events-calendar-script’ ); // relies on placeholder, resize, datepicker
    wp_dequeue_script( ‘tribe-events-bootstrap-datepicker’ );

    }
    }
    }

    #1044956
    George
    Participant

    Hey Diane,

    We unfortuantely cannot provide much help with code tweaking and such, but I’m interested in why the code you shared did not help with this…it looks fine to me. To be clear, did you also add the corresponding and required line of code that looks like this:


    add_action( 'wp_enqueue_scripts', 'dequeue_tribe_events_scripts_and_styles' );

    If you did not add a line of code like this in addition to the code you shared above, then I would recommending adding both the original block of code and the line of code above to your theme’s functions.php file.

    See how things behave.

    If issues continue to persist, try setting a different priority on the line of code I shared in this reply – for example, you could tweak the code to have a priority of 99 like this:


    add_action( 'wp_enqueue_scripts', 'dequeue_tribe_events_scripts_and_styles', 99 );

    I hope this helps!

    — George

    #1076341
    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.

    #1136782
    Geoff
    Member

    Hey there,

    We wanted to follow-up to let you know that we were able to patch this up in The Events Calendar and Events Calendar PRO 4.2.2, which is now available to download and install if you haven’t done so already.

    Please do be sure to check out our release notes for a full overview of what’s new in the release and feel free to let us know if you run into this or any other issues after the update.

    Thanks so much for your patience while we worked on this!

    Cheers,
    Geoff

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘wp_dequeue_style() and wp_dequeue_script().’ is closed to new replies.