Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ...
- /**
- * Enqueue Theme JS Files
- */
- add_action( 'wp_enqueue_scripts', 'arts_enqueue_scripts', 50 );
- function arts_enqueue_scripts() {
- $ajax_enabled = get_theme_mod( 'ajax_enabled', false );
- $gmap = get_option( 'arts_gmap' );
- $main_script_deps = array( 'modernizr', 'jquery', 'barba', 'isotope', 'imagesloaded', 'swiper' );
- // Force load Google Maps script
- // on all the pages with AJAX turned on
- if ( $ajax_enabled && isset( $gmap['key'] ) && ! empty( $gmap['key'] ) ) {
- wp_enqueue_script( 'googlemap', '//maps.googleapis.com/maps/api/js?key=' . $gmap['key'], array(), null, true );
- $main_script_deps [] = 'googlemap';
- }
- // Force load Elementor assets
- // on non-Elementor pages with AJAX turned on
- if ( class_exists( '\Elementor\Frontend' ) && ! arts_is_built_with_elementor() && $ajax_enabled ) {
- \Elementor\Frontend::instance()->enqueue_scripts();
- }
- ...
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement