diff --git a/functions.php b/functions.php index 5816fd5..b8c2ee8 100644 --- a/functions.php +++ b/functions.php @@ -6,7 +6,7 @@ function td_theme_styles() { wp_enqueue_script( 'google-maps', '//maps.googleapis.com/maps/api/js?key=AIzaSyDHNT102YHu-TP50F78bPyvf5ia6K6cjU8&callback=initMap', - array('page_pins_map'), + array(), '1.0', true ); @@ -82,11 +82,4 @@ function atravelblog_related_posts() { add_post_image_thumbs($urlaub, 'Urlaub:'); wp_reset_query(); } -} - -function enqueue_page_pins() { - // change the template file name according to your file - if ( ! is_page_template('page-pins.php') ) return; - wp_enqueue_script('page_pins_map', get_stylesheet_directory_uri() . '/js/page-pins-map.js', array('jquery'), null, true); -} -add_action('wp_enqueue_scripts','enqueue_page_pins'); \ No newline at end of file +} \ No newline at end of file diff --git a/page-pins.php b/page-pins.php index b0916e1..1e147f6 100644 --- a/page-pins.php +++ b/page-pins.php @@ -78,8 +78,9 @@ } } endwhile; + wp_enqueue_script('page_pins_map', get_stylesheet_directory_uri() . '/js/page-pins-map.js', array('jquery')); wp_localize_script('page_pins_map', 'page_pins_map', array('places' => $locations, 'traveler' => array_values($traveler))); ?> - \ No newline at end of file +