Skip Navigation

[Resolved] Map [markers] not working on CPT WordPress Archive

This support ticket is created 3 years, 6 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 3 replies, has 2 voices.

Last updated by betH-2 3 years, 6 months ago.

Assisted by: Minesh.

Author
Posts
#2139741

I'm trying to create a simple building project portfolio archive which includes a cluster map on the bottom of the archive page marking all the places a portfolio entry took place using a Maps address custom field attached to the custom post type (similar to this page: hidden link).

Unfortunately, I can't get the markers to display based on the available archive entries. I have:

- Double-checked my API
- Read what feels like every similar forum submission
- Read external tutorials
- Thrown everything at the wall to see what stuck by "Frankensteining" shortcodes together from other locations

I know the API works because when I test the map out on, say, a single content template using the block editor, the Map block picks up the location field just fine. However, on my archive page, no matter what arguments or attributes I assign, it just sits statically over in Nigeria (all of my map locations are within the United States) with no markers.

Misc details:

- I am using Legacy Views and have Legacy Maps enabled. While I am very pro-Gutenberg, I find the Toolset block views clunky and prefer the mailability of the Legacy Views
- My archive has AJAX filters and pagination (I've seen that as an issue on a couple other forums but it didn't seem to be mine after following some similar troubleshooting)
- One thing I notice on my markers input, on one of the many tutorials I read through (hidden link), the author included a marker screen shot (hidden link) - I do not get that bottom option when I include a marker, "Marker Address Comes from..." with the Google option does not appear for me. The image is from 2018, so that could have something to do with it I suppose, but I figured it was worth bringing up.

I've done similar archives before but couldn't find the differences as to why it's worked before and not working now so I had to throw in the towel and reach out. I feel like the issue is failing to connect the map to the post type, clearly, but all my attempts have seemed to fail at doing so.

The archive is on this page: hidden link
I have the debug turned on, but you can probably ignore it. I've added and removed so many attributes from that array I'm surprised the map itself is still displaying. So what it's displaying is just what happened to be in there before I finally decided to get some assistance.

#2140185

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

As I understand - you have a post type archive and as per the reference link you shared (similar to this page: hidden link), you want to display the map below the archive.

This can be achieved but I'm not sure how exactly you added the map to your archive.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2140993

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

You will have to put the marker shortcode within the loop so it will add all markers and map shortcode outside the loop.

You already added map shortcode outside the loop and I've moved and adjusted the marker shortcode as given under and added it just after the loop starts.

  
[wpv-map-marker map_id='pp-archive-map' marker_id='marker-[wpv-post-id]' marker_field='wpcf-project-location'][/wpv-map-marker]

I can see now it displays the correct map on archive page: hidden link

#2141255

So it is! I can't believe I tried everything that felt possible except that.

Hopefully this thread helps someone else out, because I didn't find any similar solution. Thanks for you help, I appreciate it!