Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: Including Latitude and Longitude of Post in RSS Feed #59875

    If someone is looking for the solution to this as well, here’s the code I placed in my functions.php file to get this to work.

    function fields_in_feed($content) {
    if(is_feed()) {
    $post_id = get_the_ID();
    $location = gmw_get_post_location( $post_id );
    $latitude = $location->latitude;
    $longitude = $location->longitude;
    $output .= ‘ Location: ‘;
    $output .= $latitude;
    $output .= ‘ , ‘;
    $output .= $longitude;
    $content = $content.$output;
    }
    return $content;
    }
    add_filter(‘the_content’,’fields_in_feed’);

    in reply to: Displaying Latitude and Longitude of Post #59832

    Thanks Eyal, that did the trick.

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