Why are my custom posts not being displayed in my map?

I'm using the shortcode [map query="post_type=listing" overlay="true"] to query all posts of my custom post type named listing.
In the Google Maps plugin settings I have set the address field name to address, which is the name of this field in my db.

Here's a link to my test

What am I doing wrong?

  • Vladislav
    • Dead Eye Dev

    Hello,

    There are a couple of things that can go wrong, but from the example you linked to, it appears as if the shortcode hasn't been processed at all. Is the plugin still active on your site? If you disabled it intentionally and this doesn't affect the issue you encountered, then is it perhaps possible that your custom post type has a bit different actual name - perhaps a prefix, or it's in the plural form? Lastly, are there any maps actually associated with your "listing"-type posts?

  • Waboom
    • Site Builder, Child of Zeus

    I disabled the plugin while testing another plugin. I have activated it again now.

    I´m pretty sure the name of the custom post type is listing, because the url for the post admin list is: /wp-admin/edit.php?post_type=listing

    /Jens

  • Vladislav
    • Dead Eye Dev

    Hi,

    Agreed, the post type name sounds right. Also, I can now see the map, but the marker array is entirely empty - however, I'm still unable to recreate the issue myself. Can we please make sure there are some associated maps with your listing posts? Also, how are you creating your maps - are they perhaps autocreated maps?

  • Waboom
    • Site Builder, Child of Zeus

    Yes, the maps on my single listing pages are autocreated. I'm using the Vantage theme from AppThemes that are creating these maps for me. But they don't support mash up maps, and I would like a map with all my listings.

  • Vladislav
    • Dead Eye Dev

    Ah, I think I understand now! The maps you want to appear are coming from another source (Vantage theme) which, unfortunately, won't work with our Maps plugin in this way. The mashup feature relies on maps being created by Google Maps and stored in the internal format recognized by our plugin. Unfortunately, this is not the case with third party maps, such as the ones created by your theme. You could set the plugin up to auto-create the maps for you and forego the ones created by your theme.

    However, there might be a way to figure this out and have it work both ways. If your listing posts have a custom field that holds the address you want mapped, you can get our plugin to auto-create the maps for you and associate them to your posts in addition to the maps created by your theme. Practically, you would end up with two sets of maps - ones created by your theme and displayed on your listing posts, and ones created by our plugin which wouldn't be shown as standalone, but only in your mashups. In this scenario, you would just set the plugin up not to automatically display the maps (as the theme already does this for you), but you do need it to auto-create them. Once this is set up, you should be able to re-save (or just visit) your listing posts and have our plugin generate maps in the background. Provided everything went well with geolocation, you should be able to render the maps in an overlay as you originally intended.

  • Waboom
    • Site Builder, Child of Zeus

    Sounds good Vladislav :slight_smile: My listing posts have a custom field named address that holds the addresses I want mapped.

    I'v tried to set up the plugin to use this custom field in settings, but it's not working.

  • Patrick
    • Support Monkey

    Hey @Waboom

    It looks like you haven't ticked "Associate the new map to post". See this is in the post by @Vladislav above...

    If your listing posts have a custom field that holds the address you want mapped, you can get our plugin to auto-create the maps for you and associate them to your posts in addition to the maps created by your theme.

  • Vladislav
    • Dead Eye Dev

    Hi,

    The reason for this is probably in that the option doesn't work in retrospect. Meaning, when the plugin checks your listing post, it sees it already has a map created for it and passes on (it's a bit more complex than this, but for our purpose here it's close enough). However, the map created for your listing post wasn't associated with it at creation time, because the option wasn't checked back then. If you don't have other maps created by our plugin on your site, the easiest way to fix this could be to activate the "Fix and Repair" add-on, and clear the existing maps by using the new "Clear the table" option. This will wipe out the generated maps, and you can then start fresh with the map association option checked. Also, please note that the maps for each of your listing posts will be generated either when you update the post in the admin area, or when you visit it on the public end of your site.

  • Patrick
    • Support Monkey

    @Waboom

    Happy new year!

    I see we're still trying to get to the bottom of this :slight_frown:

    @Vladislav mentioned this:

    Also, please note that the maps for each of your listing posts will be generated either when you update the post in the admin area, or when you visit it on the public end of your site.

    Have you tried making a small edit and updating your listings in the backend to see if the maps are then generated?

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.