Title: PHP Syntax question
Last modified: August 20, 2016

---

# PHP Syntax question

 *  Resolved [mariostella](https://wordpress.org/support/users/mariostella/)
 * (@mariostella)
 * [15 years ago](https://wordpress.org/support/topic/php-syntax-question-1/)
 * Hello,
    Quite inexpert on PHP, but I am trying to pull geo-mashup coordinates
   with a template function. I am just having issues injecting the function with
   the coordinates. I am using this function:
 * `<?php $coords = GeoMashup::post_coordinates(); echo GeoMashup::map('map_content
   =global&remove_geo_mashup_logo=true&radius_mi=10&near_lat=' . $coords['lat'] .'&
   near_lng=' . $coords['lng'] . '') ?>`
 * I am guessing I messed up here `near_lat=' . $coords['lat'] . '` (and with the
   immediately following piece of code for lng).
 * How can I inject those coordinates in the function??
    Thanks

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

 *  [Dylan Kuhn](https://wordpress.org/support/users/cyberhobo/)
 * (@cyberhobo)
 * [15 years ago](https://wordpress.org/support/topic/php-syntax-question-1/#post-2125130)
 * The syntax looks like it should work to me (you could add a semicolon at the 
   end, and the last `. ''` isn’t necessary, but these shouldn’t cause errors). 
   I’d have to be able to troubleshoot a bit to tell you for sure what’s wrong.
 *  Thread Starter [mariostella](https://wordpress.org/support/users/mariostella/)
 * (@mariostella)
 * [15 years ago](https://wordpress.org/support/topic/php-syntax-question-1/#post-2125148)
 * Actually I do not get errors, the code just does not get injected with coords,
   the map displays fine but as if there were no coordinates in the geo mashup code.
   
   If I change anything in the code above I get errors and the page does not load.
 * Maybe I am calling the coordinates wrongly? If you were to do something like 
   this how would you code it? (hint hint! :)))))) )
 * Thanks in advance
 *  [Dylan Kuhn](https://wordpress.org/support/users/cyberhobo/)
 * (@cyberhobo)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/php-syntax-question-1/#post-2125264)
 * It really looks like it should work to me. Maybe make sure the code is inside
   the loop, as the current_location() returns the coordinates of the current loop
   post.
 *  Thread Starter [mariostella](https://wordpress.org/support/users/mariostella/)
 * (@mariostella)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/php-syntax-question-1/#post-2125270)
 * It works indeed, I had a redirection issue with my test page that sent me to 
   a page without a saved map on it…sorry for the useless mess.

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

The topic ‘PHP Syntax question’ is closed to new replies.

 * 4 replies
 * 2 participants
 * Last reply from: [mariostella](https://wordpress.org/support/users/mariostella/)
 * Last activity: [14 years, 11 months ago](https://wordpress.org/support/topic/php-syntax-question-1/#post-2125270)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
