Automatic Map Creation by Address (Post Title)

Home Forums MapPress Support Automatic Map Creation by Address (Post Title)

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #14140
    angelopc
    Participant

    Is there a way to have a map automatically generated/displayed, based on the post_title, which is actually the full address? It’s for a home builder’s website. I’ve searched, but can’t find a definitive answer. I’m almost positive that maps were being generated, in this fashion, before this site went “live” (it was already “live”, but on a subdomain). Now, the maps aren’t being generated.

    #14141
    Chris
    Keymaster

    Hi,

    The maps are only generated from custom fields. The plugin doesn’t read the post title.

    If you can copy the post title to a custom field when the post is saved, that might work. Then the map could be generated from that field. For example, copy the post title to a field called ‘address’.

    That would require a little PHP. I think you could use this event:

    http://codex.wordpress.org/Plugin_API/Action_Reference/save_post

    #14142
    angelopc
    Participant

    Hey, Chris. Thanks for responding.

    I added a custom field called “actual-address”. I set MapPress to use that field for “Address Line 1”. I’m using a content template to display a custom post type of “Home” (for a home builder). The posts (Homes) are created on the front-end of the website. I’m trying to keep the client out of the back-end, just for convenience and user-friendliness. Unless “[mappress]” is added to the body of the post, using the WP editor (back-end), the maps are not generated and, therefore, not displayed.

    Any ideas on how I might overcome this issue? If I were just able to throw “address=…” into the [mappress] shortcode (in the content template), I think I’d be golden.

    #14143
    Chris
    Keymaster

    Hi,

    The [mappress] shortcode doesn’t have anything to do with auto-generation of the maps. But they don’t get generated until a post is saved or published, so maybe it’s a timing issue?

    Try this: go to a post where you have an ‘address’ custom field and publish it – you should see the map generated, without needing to put the shortcode in the post.

    The shortcode doesn’t take an ‘address’ attribute because you would then need to geocode that address every time a page is displayed. It would slow down your site and you could hit the Google usage limits (see the docs for details).

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.