Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Forked from joshfeck/add_calendar_scripts_everywhere.php
Last active September 19, 2024 11:23
Show Gist options
  • Save Pebblo/c029293f6b048a1de2d42e19423c6d97 to your computer and use it in GitHub Desktop.
Save Pebblo/c029293f6b048a1de2d42e19423c6d97 to your computer and use it in GitHub Desktop.
Add calendar scripts to a specific page. Page builder themes rejoice!
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action( 'template_redirect', 'tw_add_ee_calendar_assets' );
function tw_add_ee_calendar_assets() {
// change is_page() parameter to match your calendar page slug
if ( class_exists( 'EED_Espresso_Calendar' ) && is_page( 'whats-on' ) ) {
global $is_espresso_calendar;
$is_espresso_calendar = TRUE;
add_action( 'wp_enqueue_scripts', array( EED_Espresso_Calendar::instance(), 'calendar_scripts' ) );
if ( EED_Espresso_Calendar::instance()->config()->tooltip->show ) {
add_filter('FHEE_load_qtip', '__return_true' );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment