Title: Conditional php code for property_map
Last modified: August 15, 2017

---

# Conditional php code for property_map

 *  Resolved [mani2848](https://wordpress.org/support/users/mani2848/)
 * (@mani2848)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/conditional-php-code-for-property_map/)
 * Hi Steve,
 * Thank you for the plugin update, it’s working very well.
 * I have a question regarding the property map option on a single property page.
 * I am designing the page with tabs and the map shortcode is working very well.
   
   but I would like to show the tab element of “Map” only when the Latitude and 
   Longitude have been entered from the admin side.
 * For example I am using the code below for the “Property Features”.
 * <?php
    global $property; $features = $property->get_features(); if ( !empty($
   features) ) { ?> <input id=”tab1″ type=”radio” name=”tabs” checked> <label for
   =”tab1″>Features</label> <?php } ?>
 * Could you kindly let me know a similar code for the “Property Map” that I can
   use?
 * Thank you.
 * Mani
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fconditional-php-code-for-property_map%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [mani2848](https://wordpress.org/support/users/mani2848/)
 * (@mani2848)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/conditional-php-code-for-property_map/#post-9410768)
 * please use the link to see the single property page.
    [http://adamsteinandco.promoworxacademy.co.uk/property/commerce-house-1-raven-road-south-woodford-e18/](http://adamsteinandco.promoworxacademy.co.uk/property/commerce-house-1-raven-road-south-woodford-e18/)
 * Thanks.
 *  Plugin Author [Property Hive](https://wordpress.org/support/users/propertyhive/)
 * (@propertyhive)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/conditional-php-code-for-property_map/#post-9417867)
 * Hi Mani,
    The way we normally do this is something like:
 *     ```
       if ( $property->latitude != '' && $property->longitude != '' )
       {
           // we have co-ordinates. Display map/tab etc
       }
       else
       {
           // we don't have co-ordinates
       }
       ```
   
 * Hope that helps,
    Steve

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Conditional php code for property_map’ is closed to new replies.

 * ![](https://ps.w.org/propertyhive/assets/icon-256x256.gif?rev=3206072)
 * [Property Hive](https://wordpress.org/plugins/propertyhive/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/propertyhive/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/propertyhive/)
 * [Active Topics](https://wordpress.org/support/plugin/propertyhive/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/propertyhive/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/propertyhive/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Property Hive](https://wordpress.org/support/users/propertyhive/)
 * Last activity: [8 years, 9 months ago](https://wordpress.org/support/topic/conditional-php-code-for-property_map/#post-9417867)
 * Status: resolved