GEO my WP Support

Use this forum for technical support and general questions related to GEO my WP plugin and its core add-ons only. For technical support and general questions related to any of the premium extensions please open a new premium support ticket.

[Not resolved]Including Latitude and Longitude of Post in RSS Feed

Forums Support Including Latitude and Longitude of Post in RSS Feed

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #59862

    Is it possible to include the latitude and longitude of a post within the RSS feed? It doesn’t necessarily need to include a map but that might be handy as well.

    #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’);

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

You must be logged in to reply to this topic.