Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Created August 21, 2018 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshfeck/bca903a5db194f5620462032b92e445c to your computer and use it in GitHub Desktop.
Save joshfeck/bca903a5db194f5620462032b92e445c to your computer and use it in GitHub Desktop.
Add calendar scripts to specific pages. 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', 'my_add_ee_calendar_array' );
function my_add_ee_calendar_array() {
if ( class_exists( 'EED_Espresso_Calendar' ) && is_page( array(
'calendar', // change is_page() array items to match your calendar page slugs
'seminars',
'events',
'classes',
// add more items here, be sure to include the comma before adding another line
) ) ) {
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