Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1408421
    Mastres
    Participant

    Hi i want to dissable zoom scroll in google maps, i found this https://developers.google.com/maps/documentation/javascript/

    This is the code:

    <div id="map"></div>
        <script>
          function initMap() {
            // Create a map object and specify the DOM element for display.
            var map = new google.maps.Map(document.getElementById('map'), {
              center: {lat: -34.397, lng: 150.644},
              scrollwheel: false,
              zoom: 8
            });
          }
    
        </script>
        <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap"
        async defer></script>

    How can i insert this as custom code in corner stone or in my functions.php of my child theme? i know very basic Javascript

    Thanks for help!!

    #1409049
    Friech
    Moderator

    Hi There,

    Thank you for writing in! You can add the code below with your script on the child theme’s functions.php file.

    function my_custom_footer_output() {  ?>
    
     <!-- YOUR JAVASCRIPT HERE -->
    
    <?php  }
    add_action( 'wp_footer', 'my_custom_footer_output', 99999 ); ?>

    This will output your script just before the </body> tag.

    Hope it helps, Cheers!

  • <script> jQuery(function($){ $("#no-reply-1408421 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>