how can i show a google map in custom post type

$prop_mapaddress contains your textfield value: <?php if(isset($prop_mapaddress)) { global $post; global $wpdb; $fromat_address = trim($prop_mapaddress); $fromat_address = str_replace(” “,”+”,$fromat_address); $address_obj = file_get_contents(“http://maps.googleapis.com/maps/api/geocode/json?address=”.$fromat_address.”&sensor=false”); $address_obj =json_decode($address_obj); $latitude = $address_obj->results[0]->geometry->location->lat; $longitude = $address_obj->results[0]->geometry->location->lng; ?> <script> var geocoder; var map; var lat = “<?php echo $latitude ?>”; var lng = “<?php echo $longitude; ?>”; function initialize() { geocoder = … Read more

Understanding WordPress Search

The default search is handled by WP_Query mostly by a method called parse_search(), which is triggered by the s parameter. You can search the source of WP_Query for is_search and piece together a few other bits and pieces. Or you can just create a query… $s = new WP_Query(array(‘s’ => ‘test’)); … dump the SQL… … Read more

create dynamic google map with iframe api

Step one: Familiarize yourself with Google Maps Embed API; and sign up for API key: The iframe embed option, unlike the Javascript API, does not have usage limits but does not have as many options/features. Determine which MODE you require and observe the required url format and parameters. Step two: Collect address from user. For … Read more

Where to paste Google Map Snippet / JavaScript / CSS for WordPress integration

The JS in the fiddle should be saved to a file, for example, scripts.js. If this was in a folder in the theme root called js you could enqueue the scripts like so: function add_wp_scripts() { wp_enqueue_script( ‘google-maps’, ‘https://maps.googleapis.com/maps/api/js’, array(), null, null ); wp_enqueue_script( ‘script’, get_template_directory_uri() . ‘/js/script.js’, array(), null, true ); } add_action( ‘wp_enqueue_scripts’, … Read more

Where is my google maps on my page? [closed]

The map is output in the page template. A search of Github for the term skt_moveMap() (which seemed like a unique function name) revealed that the Google Maps code from your question is part of the “Contact page Template with Sidebar” (template-contact-with-sidebar.php) or “Contact page Template” (template-contact-page.php) templates included in themes from SketchThemes. Looking at … Read more