Title: conditionals?
Last modified: August 30, 2016

---

# conditionals?

 *  Resolved [yhdm](https://wordpress.org/support/users/yellowhousedesign/)
 * (@yellowhousedesign)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/conditionals-2/)
 * Are there conditionals available to check if geo information exists? For example:
 *     ```
       if (condition) {
            echo 'your postal code is ';
            echo do_shortcode( '[postalcode]' );
       }
       ```
   
 * I’ve noticed that when I’m in network at my office, the postal code does not 
   show up. I would like to avoid showing:
 * > your postal code is
 * [https://wordpress.org/plugins/wpengine-geoip/](https://wordpress.org/plugins/wpengine-geoip/)

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

 *  Plugin Contributor [Taylor McCaslin](https://wordpress.org/support/users/taylor4484/)
 * (@taylor4484)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/conditionals-2/#post-6291309)
 * Hi yellowhousedesign,
 * There are some cases where GeoIP can’t identify the GeoData for specific locations.
   We are working to improve the accuracy of GeoIP.
 * While we don’t have conditional helper functions (though I will take that feedback
   back to our development team), it would be easy to do this via PHP referencing
   the PHP environment variables that GeoIP adds, it’d look something like this:
 * Available GeoIp Environment Variables:
 *     ```
       getenv( 'HTTP_GEOIP_COUNTRY_CODE' )
       getenv( 'HTTP_GEOIP_COUNTRY_NAME' )
       getenv( 'HTTP_GEOIP_LATITUDE' )
       getenv( 'HTTP_GEOIP_LONGITUDE' )
       getenv( 'HTTP_GEOIP_AREA_CODE' )
       getenv( 'HTTP_GEOIP_REGION' )
       getenv( 'HTTP_GEOIP_CITY' )
       getenv( 'HTTP_GEOIP_POSTAL_CODE' )
       ```
   
 * Conditional:
 *     ```
       if ( isset( 'HTTP_GEOIP_POSTAL_CODE' ) ) {
            echo 'your postal code is ';
            echo do_shortcode( '[postalcode]' );
       }
       ```
   
 *  Thread Starter [yhdm](https://wordpress.org/support/users/yellowhousedesign/)
 * (@yellowhousedesign)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/conditionals-2/#post-6291486)
 * Perfect – thank you!

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

The topic ‘conditionals?’ is closed to new replies.

 * ![](https://ps.w.org/wpengine-geoip/assets/icon-256x256.png?rev=1101492)
 * [WP Engine GeoTarget](https://wordpress.org/plugins/wpengine-geoip/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpengine-geoip/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpengine-geoip/)
 * [Active Topics](https://wordpress.org/support/plugin/wpengine-geoip/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpengine-geoip/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpengine-geoip/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [yhdm](https://wordpress.org/support/users/yellowhousedesign/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/conditionals-2/#post-6291486)
 * Status: resolved