• Greetings,
    My global map is sorting map markers alphabetically by post title, I would like by post_date or geo_date.

    I have tried [geo_mashup_map sort=”geo_date”] with no luck.

    I also have [geo_mashup_visible_posts_list] on the same page and have tried [geo_mashup_visible_posts_list sort=”geo_date”] with no luck either.

    The post marker I need on top has the newest geo_date and post_date but it is the oldest post_id and in the middle alphabetically.

    I found a possible answer on your support post https://wordpress.org/support/topic/costum-fields-to-select-posts-for-map

    Would this work?

    $custom_query = new WP_Query( array(
    'post_type' => 'post',
    'orderby' => 'post_date',
    'order' => 'DESC'
    ) );

    echo GeoMashup::map( array(
    'map_content' => $custom_query,
    ) );

    I would prefer a shortcode way. I don’t want to enable php in posts.

    Thank you for this excellent plugin.

    Cheerz

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

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

    (@cyberhobo)

    The visible posts is currently limited this way – it doesn’t respond to the query or the sort parameter. There’s a long standing request to make improvements to it that has not been implemented: https://github.com/cyberhobo/wordpress-geo-mashup/issues/175

    Thread Starter mydiskdriveonline

    (@mydiskdriveonline)

    Thanks for the response.

    I ended up making a page template with:

    $custom_query = new WP_Query( array(
    'post_type' => 'post',
    'orderby' => 'geo_date',
    'order' => 'ASC',
        'map_content' => 'global',
                'map_type' => 'G_NORMAL_MAP',
    			'posts_per_page' => -1
    ) );
    
    echo GeoMashup::map( array(
    'map_content' => $custom_query,
    ) );

    I played around with all of the variables and couldn’t get it to work.

    So if I remove the visible posts tag in the page content will the map then order by geo_date?

    Plugin Author Dylan Kuhn

    (@cyberhobo)

    If you’re talking about z-index order, the map providers have their own behavior for that. If I remember Google uses latitude for it, so query order will not affect it at all. You’d have to use the javascript API to change it.

    https://github.com/cyberhobo/wordpress-geo-mashup/wiki/Javascript-API

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

The topic ‘map marker sort order’ is closed to new replies.