Home › Forums › Calendar Products › Community Events › wp_dequeue_style() and wp_dequeue_script().
- This topic has 4 replies, 4 voices, and was last updated 9 years, 9 months ago by
Geoff.
-
AuthorPosts
-
December 20, 2015 at 12:33 am #1044184
Diane
Participantis there some code I can use to dequeue styles and scripts for ECP if not on events page or home page?
December 20, 2015 at 11:55 pm #1044478Diane
Participanti 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’ );}
}
}December 21, 2015 at 5:44 pm #1044956George
ParticipantHey 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
February 18, 2016 at 8:33 am #1076341Support Droid
KeymasterThis 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.July 7, 2016 at 12:27 pm #1136782Geoff
MemberHey 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 -
AuthorPosts
- The topic ‘wp_dequeue_style() and wp_dequeue_script().’ is closed to new replies.
