Title: Get PHP values from $entry variable
Last modified: March 27, 2024

---

# Get PHP values from $entry variable

 *  Resolved [dcfunkster](https://wordpress.org/support/users/dcfunkster/)
 * (@dcfunkster)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/get-php-values-from-entry-variable/)
 * I’m attempting to edit the theme files within the confines of a child theme on
   my website. I want to add a Google Map embed on every `card-single.php` page 
   that retrieves the address value from the entry, and inputs into a Google Maps
   iframe, but the documentation for retrieving these values isn’t great on the 
   Connections website.
 * How do I retrieve fields from the entry? Is there a custom `$entry->getAddress()`
   function I should be using for this? `$entry->getAddressBlock()` doesn’t work
   for me as it adds a bunch of extra HTML that I don’t need.

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

 *  Plugin Author [Steven](https://wordpress.org/support/users/shazahm1hotmailcom/)
 * (@shazahm1hotmailcom)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/get-php-values-from-entry-variable/#post-17533588)
 * The method is `$entry->getAddresses()`. Here’s the link to the doc, in the code.
    - [https://github.com/Connections-Business-Directory/Connections/blob/413fd04a633c8f256639280151fa775360602bdd/includes/entry/class.entry-data.php#L1468](https://github.com/Connections-Business-Directory/Connections/blob/413fd04a633c8f256639280151fa775360602bdd/includes/entry/class.entry-data.php#L1468)
 * As you are interested in a Map, you should look at this method too:
    - [https://github.com/Connections-Business-Directory/Connections/blob/10.4.65/includes/entry/class.entry-html.php#L1392](https://github.com/Connections-Business-Directory/Connections/blob/10.4.65/includes/entry/class.entry-html.php#L1392)
 * I hope this helps; please let me know.
 *  Thread Starter [dcfunkster](https://wordpress.org/support/users/dcfunkster/)
 * (@dcfunkster)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/get-php-values-from-entry-variable/#post-17560599)
 * This helps immensely, thank you! Just what I was looking for.
   I tried the built-
   in map functionality, and it’s not quite what I’m looking for. I don’t like the
   design of the included map, and it looks like I’d have to press the “Geolocation”
   button on every single entry, which there are hundreds of already and that would
   be a big hassle.
 *  Plugin Author [Steven](https://wordpress.org/support/users/shazahm1hotmailcom/)
 * (@shazahm1hotmailcom)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/get-php-values-from-entry-variable/#post-17560885)
 * **RE: I don’t like the design of the included map**
 * It will be either the Google Map tiles, if you enable the Google Maps API key,
   or the OSM Map tiles.
 * **RE: it looks like I’d have to press the “Geolocation” button on every single
   entry**
 * The latitude and longitude are required to display the map pins. Geolocation 
   is done automatically when adding a new entry or adding an address to an entry.
   If you are missing this info, it is because the address could not be geolocated.
   The free OSM service can be hit or miss, especially outside of the US. I recommend
   using Google Maps, as that is far more reliable.
 * You could geolocate using JS, but that would have to be done on each page load,
   so it would be far slower than attaching the lat and lng to each address.
 * I hope this helps; please let me know.
 *  Thread Starter [dcfunkster](https://wordpress.org/support/users/dcfunkster/)
 * (@dcfunkster)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/get-php-values-from-entry-variable/#post-17687859)
 * Ohh, I was probably using the free OSM map tiles then, that makes sense.
 * I still would have to press the “Geolocate” button every entry in this instance,
   as all of my entries are already imported (200+), with addresses already added.
   It was easier just to add the Google Maps JS API to the site and calculate the
   geolocation per entry.
 * Thanks for your help!

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

The topic ‘Get PHP values from $entry variable’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/connections_2b7e99.svg)
 * [Connections Business Directory](https://wordpress.org/plugins/connections/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/connections/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/connections/)
 * [Active Topics](https://wordpress.org/support/plugin/connections/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/connections/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/connections/reviews/)

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)
 * [template](https://wordpress.org/support/topic-tag/template/)

 * 4 replies
 * 2 participants
 * Last reply from: [dcfunkster](https://wordpress.org/support/users/dcfunkster/)
 * Last activity: [2 years, 1 month ago](https://wordpress.org/support/topic/get-php-values-from-entry-variable/#post-17687859)
 * Status: resolved