Add routes between multiple ACF google maps markers [closed]

I’ve managed to work around this by using Gmaps.js. function initMap($el) { var bounds = []; var waypts = []; var $markers = $($el).find(‘.marker’); var map = new GMaps({ div: $el, scrollwheel: false, zoomControl : true, zoomControlOpt: { style: ‘LARGE’, position: ‘TOP_RIGHT’ }, panControlOpt: { position: ‘TOP_RIGHT’ } }); $markers.each(function() { // DEFINE CURRENT/NEXT MARKER … Read more

ACF Google Maps – Multiple Pins

I’ve achieved this in the following website check the “Ubicación” bock. I did this using ACF Pro (5.0). Im sharing you the code you need in order to implement this. Hope this is what you are looking for (there are a few extra fields that are not needed). <?php $image = get_field(‘location_background_image’, ‘option’); $size=”background”; $location_background_image_url … Read more

Foreach loop inside foreach loop?

Your 2nd foreach loop is a bug. $slug is a string with a single value, and you cannot pass a string to a foreach loop. If you set debug to true, you will see an error message telling you just this. You can simply just do //Different markers for different types $car_type = get_the_terms( $post->ID, … Read more

Implement Google Maps JS on WordPress

First of all enqueue the Google Maps API js in the right way. look for a function which is hooked on wp_enqueue_scripts and wp_enqueue_script() to enqueue Google Maps API function wp_mk_scripts() { if ( is_singular() ) { wp_enqueue_script( ‘wp-mk-maps-js’, ‘https://maps.googleapis.com/maps/api/js’, array( ‘jquery’ ), null, true ); wp_enqueue_script( ‘wp-mk-gmaps-function’, get_stylesheet_directory_uri() . ‘/js/maps.js’, array( ‘jquery’ ), null, … Read more

Google Maps API in wordpress

Figured it out!!!!! Since we get the SQL query result with the help of “$wpdb” object we can access each row’s attribute as an associative array. As a result there isn’t a need for “mysql_fetch_assoc()” and “mysql_query()” functions. Also we need to define “$wpdb” object, so we require “wp-config.php” file.

Display posts on a map

The GPS position is saved on two post meta fields: geo_latitude and geo_longitude. You can use these meta values to draw the posts as markers on a Google Maps. For example, using Google Maps API, you could have a template like this: <h1>Posts on map</h1> <div id=”map” style=”height: 400px;”></div> <script> // init map with the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)