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

How to show all CPT posts in one page?

I think you can do this if you think through how the template hierarchy works carefully enough. archive-post.php should handle your standard post post types archive.php would then handle the rest of the archives You may want specialized category– category.php or tag archives– tag.php A similar pattern should work for single post display. single-post.php should … Read more

Add term for custom taxonomy from front end

Your code doesn’t assign the terms to the post. You can do this with wp_set_post_terms() which does: Set terms for a post. Simplified usage example: $pet_cat_ term = $_POST[‘pet_category’]; wp_set_post_terms( $post_id, $pet_cat_ term, ‘pet-category’ ); Additional note: use the id as value for your term select(s), to prevent problems, i.e. because for hierarchical terms you … Read more