• Resolved cloudduster

    (@cloudduster)


    hello dylan,

    i’ve been trying this the whole day and i can’t just get it to work. pls help me.

    am using ‘allow php in post and pages’ plugin to create shortcodes of geomashup wherever i like to put it.

    echo GeoMashup::list_located_posts ( array(
    ‘near_lat’ => ‘10.310661’,
    ‘near_lng’ => ‘123.980167’,
    ‘radius_km’ => ‘1’,

    what i want to do is to pass the values from the custom field like this:

    $lat = get_custom_field(‘custom_lat’, FALSE);
    $lng = get_custom_field(‘custom_lng’, FALSE);

    ‘near_lat’ => ‘.$lat.’,
    ‘near_lng’ => ‘.$lng.’,

    but it won’t let me save it, error. am i doing right? the way i assign these values to the fields?

    by the way, i tried

    echo $lat and it displayed the correct value, so it’s passing it successfully.

    https://wordpress.org/plugins/geo-mashup/

Viewing 1 replies (of 1 total)
  • Plugin Author Dylan Kuhn

    (@cyberhobo)

    I recommend using templates if you need PHP code, but either way you’ll have to use correct PHP syntax. My guess is that you are using a string, '.$lat.' where you just want the variable, $lat.

Viewing 1 replies (of 1 total)
  • The topic ‘assigning value from custom field’ is closed to new replies.