Can't dequeue style

Home Forums Calendar Products Events Calendar PRO Can't dequeue style

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1377132
    Andy Clements
    Participant

    I’m trying to dequeue tribe-events-calender-style and tribe-events-calendar-pro-style, but for some reason, it’s not working when I load in a calendar via the [tribe_events] shortcode. No matter what I try, it always loads in the styles. What am I doing wrong? I’m using the below code to dequeue styles, which works fine on the main Events page.

    function dequeue_tribe_styles() {
    
    	// Dequeue events calendar stylesheets
    	wp_dequeue_style( 'tribe-events-full-calendar-style' );
    	wp_dequeue_style( 'tribe-events-calendar-style' );
    	wp_dequeue_style( 'tribe-events-calendar-full-mobile-style' );
    	wp_dequeue_style( 'tribe-events-calendar-mobile-style' );
    	wp_dequeue_style( 'tribe-events-full-pro-calendar-style' );
    	wp_dequeue_style( 'tribe-events-calendar-pro-style' );
    	wp_dequeue_style( 'tribe-events-calendar-full-pro-mobile-style' );
    	wp_dequeue_style( 'tribe-events-calendar-pro-mobile-style' );
    
    }
    add_action( 'wp_enqueue_scripts', 'dequeue_tribe_styles', 999 );

    Demo link: http://deerfieldparks.myweblinx.net/sachs-rec-center/group-exercise/

    #1378555
    Barry
    Member

    Hi Andy,

    Thanks for contacting us!

    Please note we can’t provide in-depth support for customizations like this one, but I’d be happy to bat a few ideas around and even point you in the right direction if I can 🙂

    In this case, how about keeping your snippet “as is” but add the following line to the bottom:

    add_action( 'tribe_events_pro_tribe_events_shortcode_post_render', 'dequeue_tribe_styles' );
    

    Might that help with this?

    #1379261
    Andy Clements
    Participant

    Thanks so much, that did the trick 🙂

    #1379459
    Barry
    Member

    Excellent, glad it worked.

    I’ll go ahead and close out this topic but if we can help with anything else please don’t hesitate to post a new topic and one of the team will be only too happy to assist 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Can't dequeue style’ is closed to new replies.