Cannot Hide Google Map if custom field is blank
I would try if ( $map && $map != “” ) as you set the variable, but it can also contain an empty string.
I would try if ( $map && $map != “” ) as you set the variable, but it can also contain an empty string.
Get all Images: $all_images = get_posts( array( ‘post_type’ => ‘attachment’ ,’numberposts’ => -1 ) ); foreach ( $all_images as $img ) echo $img; Some notes: You can use extract to make your code shorter: extract( $image[‘image_meta’], EXTR_SKIP ); echo $latitude; Use Yoda Conditions. When writing php on one line, you can also use shorthand php: … Read more
Sorry! Turns out the problem with query_posts failing here was due to my PHP memory_limit. I changed it from 8mb to 128mb and the problem goes away.
I’m not sure to understand what you want here… You want something like yelp on the right? ( here ) That will update the website when you change your map boundaries? Edit: I think you should look at this plugin . Is it this?
On post save the ‘save_post’ action is run. You could hook your function that geolocates to that.
Plugin – including external javascript calling google maps
If you check the JavaScript error console, you’ll see the plugin is throwing an error: Error: SyntaxError: missing ) after condition Source File: http://www.associatedkyotoprogram.dreamhosters.com/wp-content/plugins/comprehensive-google-map-plugin/assets/js/cgmp.framework.min.js?ver=7.0.31 Line: 33, Column: 60 Source Code: tions”).val();d=w(d);m=parseFloat(a.fn.jquery);if(1.3>m && m~=1.10)return alert(i.oldJquery),!1;if(“undefined”== If you look at the plugin page, you’ll that the majority of people are reporting the plugin as broken, and it … Read more
You can separate it into two functions by using following code : <?php add_action(‘tmpl_detail_page_custom_fields_collection’,’custom_fields_colletion’); /* Name : custom_fields_colletion Desc : Return the custom fields collection for detail/single page */ function custom_fields_colletion() { global $wpdb,$post,$detail_post_type; $detail_post_type = $post->post_type; if(isset($_REQUEST[‘pid’]) && $_REQUEST[‘pid’]) { $cus_post_type = get_post_type($_REQUEST[‘pid’]); $PostTypeObject = get_post_type_object($cus_post_type); $PostTypeLabelName = $PostTypeObject->labels->name; $single_pos_id = $_REQUEST[‘pid’]; } else … Read more
Using Custom Field in Google Map Embed Code Works in One Theme, Not Another
Plugin options with googlemap iframe