Skip Navigation

[Resolved] Is there a way to show ALL custom post markers on a single Archive map

This support ticket is created 6 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 7 replies, has 3 voices.

Last updated by Christian Cox 6 years, 2 months ago.

Assisted by: Christian Cox.

Author
Posts
#1115895

I have a custom post type EVENTS.

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.

Any way to remedy that?

#1116505

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Paul,

Thank you for contacting our support forum.

What you probably need to do is to create a view that lists all the post markers and add that view to your archive.

This view will target the map id of the one that is placed in the archive.

Now you will need to remove the markers from the archive so that you don't have double markers but this method should work for you.

Thanks,
Shane

#1117139

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?

#1117203

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screen Shot 2018-09-28 at 9.12.20 AM.png

Hi Paul,

It doesn't need to be separate but in your case you want to display all the maps markers even if the archive isn't displaying all the posts.

There is a way to limit the display by using the pagination settings for the archive. See Screenshot

Usually the limit on the page will determine the number of markers being displayed.

Thanks,
Shane

#1117340

"...in your case you want to display all the maps markers even if the archive isn't displaying all the posts."

Not exactly.

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).

By default, it doesnt seem capable of doing that.

#1118538

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.

#1120395

OK. Thanks.

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?

#1120872

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.