Website Summary Files Commits Branches @commit @diff @stats
path: root / wp-content / themes / carmag / functions.php
diff options
context:
space:
mode:
1 files changed, 8 insertions, 1 deletions
-rw-r--r--wp-content/themes/carmag/functions.php9
diff --git a/wp-content/themes/carmag/functions.php b/wp-content/themes/carmag/functions.php
index ed3e9fa..097dc6f 100644
--- a/wp-content/themes/carmag/functions.php
+++ b/wp-content/themes/carmag/functions.php
@@ -172,7 +172,7 @@ function carmag_scripts() {
// And the only JS file that is build with Gulp
wp_enqueue_script( 'scripts', get_template_directory_uri() . '/assets/dist/scripts/bundle' . $suffix . '.js', array( "jquery" ), DX_ASSETS_VERSION, true );
-
+ wp_localize_script('scripts', 'MAPS_API_KEY', MAPS_API_KEY );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
@@ -187,3 +187,10 @@ function carmag_remove_html_margin() {
remove_action( 'wp_head', '_admin_bar_bump_cb' );
}
add_action( 'get_header', 'carmag_remove_html_margin' );
+
+function google_maps_script() {
+ if ( is_single() && 'post' == get_post_type() ) {
+ wp_enqueue_script('singe_vehicle', '//maps.googleapis.com/maps/api/js?key=' . MAPS_API_KEY, NULL, '1.0', false);
+ }
+}
+add_action('wp_enqueue_scripts', 'google_maps_script'); \ No newline at end of file