Limiting the number of posts on mashup map

Home Forums MapPress Support Limiting the number of posts on mashup map

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #9575
    wiewasmeinsch
    Participant

    Hi

    I have a nice mashup map with the following code: [mashup width=”830″ height=”375″ maptypeid=terrain center_lat=”15.90279″ center_lng=”10.037849″ zoom=”2″]. Now, with more and more entries, the mashup map is increasingly overcrowded and I would like to show only the markers of the latest (let’s say 20) posts.

    Could somebody please advise me on how to do that? I tried with adding “posts_per_page=20”, to no avail.

    Thanks for your help!

    Cheers

    #9576
    Chris
    Keymaster

    Hi, posts_per_page is the way to go. Can you provide an example of your code or shortcode? And what happened when you tried it?

    #9577
    wiewasmeinsch
    Participant

    Thanks for coming back to me.

    Please have a look at my initial post, is that the shortcode you mean? When I added “posts_per_page” nothing happened, Mappress would still output markers from all posts.

    #9578
    Chris
    Keymaster

    Sorry, I meant I’d like to see your shortcode with “posts_per_page” in it, since I didn’t see any query in that shortcode.

    If you use the mashup shortcode with no query, the plugin will try to show all posts.

    If you use a query in the shortcode you can limit which posts are searched and limit the number of results.

    There are some examples in the documentation, but basically you could use something like this:
    [mashup show=”query” show_query=”posts_per_page=-1&post_type=any”]

    That query will search ALL posts so you might want to also specify a category or tag to limit which posts are checked for maps.

    #9596
    wiewasmeinsch
    Participant

    Hi Chris

    The query code works just fine but I fail to combine the query part with the other elements but make the map look like I want. So either I have my post limited but the map is not customised or I have a nice map with all posts. I would need to somehow integrate the query part into my existing code. Is this possible? If yes, how?

    Thank you so much for taking the time to help me out here. I tried with the documentation but cannot find help on this particular problem.

    Christian

    #9625
    Chris
    Keymaster

    Hi Christian,

    I’m sorry, I’m not sure I understood your question.

    Could you provide an example or URL to show what you mean?  If you’re asking about a shortcode, can you provide the exact shortcode you’re using?

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.