Created
March 10, 2015 16:20
-
-
Save kellenmace/5b066f839913f0bccbda to your computer and use it in GitHub Desktop.
trivium enqueue scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function trivium_enqueue_scripts() { | |
wp_enqueue_style( 'parent-style', get_template_directory_uri() .'/style.css' ); | |
// Use is_page_template() conditional so this only loads on page-results.php and single-event.php | |
wp_enqueue_script( 'google-maps', 'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false' ); | |
wp_enqueue_script( 'trivium-scripts', get_stylesheet_directory_uri() .'/js/trivium-scripts.js', array( 'jquery', 'google-maps' ) ); | |
// jQuery DataTables scripts & styles for Results | |
if ( is_page( 'Results' ) || is_page( 'Event List' ) ) { | |
wp_enqueue_style( 'datatables-css', '//cdn.datatables.net/1.10.4/css/jquery.dataTables.css' ); | |
wp_enqueue_script( 'datatables-js', '//cdn.datatables.net/1.10.4/js/jquery.dataTables.js', 'jquery' ); | |
} | |
// FullCalendar scripts & styles for Event Calendar page | |
if ( is_page( 'Event Calendar' ) ) { | |
wp_enqueue_style( 'fullcalendar-styles', get_stylesheet_directory_uri() .'/inc/fullcalendar.css' ); | |
wp_enqueue_script( 'event-calendar', get_stylesheet_directory_uri() .'/js/event-calendar.js', 'jquery' ); | |
wp_enqueue_script( 'fullcalendar-moment', get_stylesheet_directory_uri() .'/js/moment.min.js', 'jquery' ); | |
wp_enqueue_script( 'fullcalendar', get_stylesheet_directory_uri() .'/js/fullcalendar.min.js', array( 'jquery', 'fullcalendar-moment' ) ); | |
} | |
} | |
add_action( 'wp_enqueue_scripts', 'trivium_enqueue_scripts' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment