in the Archive page I have a map that shows multiple events.
That part is easy.
The problem is that in the pagination settings, it looks like 50 is the maximum number of posts.
So the map is misleading in that it doesn't show ALL the events. Only those on the first page.
So if I understand correctly, any filters applied to the Archive list need top be separated from filters applied to the map.
Correct?
Is there a hard coded limit on how many archive items can be listed on a single page?
Is there any hard coded limit on how many map markers can be displayed on a single map?
Hi, Shane is on holiday for a few days so I will try to continue assisting you here. I want the map to show ALL the markers that are contained in the FILTERED Archive list (even if that list is broken over two or more pages).
Yes, this is possible with one WordPress Archive and one View. Consider the WordPress Archive and the View as separate components. Here's how you set it up:
- Create a WordPress Archive for a single custom post type (CPT) and apply any desired Query Filters and Pagination settings.
- Add a map shortcode to the archive, but do not add any marker shortcodes in the Loop.
- Add other content to the loop, like the post link shortcode.
- Check the WP Archive on the front-end of the site to ensure the results are correct and pagination works as expected.
- Create a separate View for the same CPT and apply the same Query Filters, but no pagination The Query Filters applied to the WordPress Archive must be applied identically to the View - i.e. the Query Filter criteria and any corresponding URL parameters must be identical.
- Insert a marker shortcode in the loop, targeting the ID of the map you placed in the WP Archive loop.
- Insert the View in the WordPress Archive just before the wpv-loop tag.
- Create separate WP Archives for each CPT rather than reusing the same WP Archive for multiple post types, because a View's content selection cannot be dynamic based on the current WP Archive.
One question. You said:
"- Add a map shortcode to the archive, but do not add any marker shortcodes in the Loop."
AND
"- Insert a marker shortcode in the (Views) loop, targeting the ID of the map you placed in the WP Archive loop."
So just to confirm, you are saying that the Archive should contain the map but NO markers and the View should contain the markers but NO map? Right?
And as long as the search filter parameters are identical it should all work?
So just to confirm, you are saying that the Archive should contain the map but NO markers and the View should contain the markers but NO map? Right?
That's correct, Map in the Archive, Markers in the View. As long as the Map IDs match in these shortcodes, there is no problem placing them in separate components like this.
And as long as the search filter parameters are identical it should all work?
That's the idea, yes. The View will respond to the same URL parameters as the WordPress Archive, but the View will show all results with no pagination. You can apply custom search filters on the front-end WordPress Archive, and the View will update to show the corresponding results when the page reloads. AJAX updates in the WordPress Archive probably aren't supported, but I haven't tested that approach.