Home › Forums › MapPress Support › Limiting the number of posts on mashup map
- This topic has 5 replies, 2 voices, and was last updated 14 years, 2 months ago by
Chris.
-
AuthorPosts
-
June 8, 2012 at 4:54 am #9575
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
June 8, 2012 at 5:40 am #9576Hi, 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?
June 8, 2012 at 7:03 am #9577Thanks 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.
June 8, 2012 at 9:18 am #9578Sorry, 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.
June 11, 2012 at 6:37 pm #9596Hi 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
June 13, 2012 at 7:13 pm #9625Hi 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?
-
AuthorPosts
- You must be logged in to reply to this topic.
