Geo Mashup
[resolved] [Geo Mashup] - User filter (2 posts)

  1. Mart456
    Posted 3 years ago #

    Hi all

    i currently have a travel site where each users has their own located posts,

    I would like to create a couple of maps that filter by the authors id e.g

    1) when viewing a single post, or the users profile page a map of their posts is shown.

    2) when on the global map, i would like user to be able to a) filter the map by user, maybe a drop down box or checkbox,b) As part of the display window include a link to the a map filtered by that users posts.

    Any help would be really appreciated,


    Many thanks



  2. Dylan Kuhn
    Plugin Author

    Posted 3 years ago #

    Number 1 should be achievable using a secondary query and a contextual map in your template. For a single post, this might look like

    $post = get_queried_object();
    query_posts( 'posts_per_page=-1&author=' . $post->post_author );
    echo GeoMashup::map( 'map_content=contextual' );

    in Geo Mashup 1.5 you can use a WP_Query instead:

    $post = get_queried_object();
    $author_query = new WP_Query( 'posts_per_page=-1&author=' . $post->post_author );
    echo GeoMashup::map( array( 'map_content' => $author_query ) );

    Number 2 is possible also with some custom javascript and info window template development, but there isn't a built-in control that does it.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic