Website Summary Files Commits Branches @commit @diff @stats
path: root / wp-content / themes / carmag / functions.php
diff options
context:
space:
mode:
Commit4751e021fd0f8bd6cb71945af8f4e9cf41acbed3 (patch)
Author
 Ivan Dimitrov <ivan.dimitrov293@gmail.com>
2020-07-08 22:24:05 +0300
Committer
 Ivan Dimitrov <ivan.dimitrov293@gmail.com>
2020-07-08 22:24:05 +0300
Files6dac2882e3b359450c7b36dec8c523c82b09c91f /wp-content/themes/carmag/functions.php
tues-interns-2020-feature/tos-pp.tar
tues-interns-2020-feature/tos-pp.tar.gz
tues-interns-2020-feature/tos-pp.zip
Parenta2a785a17d4cdeee856685a6e0792d272c9338ef (diff)
Parentd806454c3a25475c0e365e17a7d3bc7cad633df8 (diff)
[Update] Synced with master feature/tos-pp
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