Custom Fields and Mashup

Home Forums MapPress Support Custom Fields and Mashup

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #11977
    timd
    Participant

    Hi there,

    Two questions / cries for help:

    1. I have a number of post types, most of which adopt a custom field which is the full address associated with the post. This is obviously going to be used as the custom field which Mappress requires.

    I’ve set the first line of the address to this field but the map doesn’t want to pin the address at all?

     

    2. Once thats fixed I’d like to create a mashup map for each of the custom post types and the posts within them. e.g All the ‘Bar’ locations on one map. How do i go about tagging the posts so I can use the custom query tool to pull in the appropriate locations.

    Many thanks

    Tim

    #11979
    timd
    Participant

    PS I did by your pro version  so have that functionality.

    the maps on the posts are going into a widget so any of either your widget, shortcode or PHP solutions would be great! Thanks

    #12143
    magnaromagna
    Participant

    Hello, I have the same two questions (I bought Pro Mappress).

    If you solved, can you share the tip? Otherwise, waiting for support..

    #12144
    Chris
    Keymaster

    Hi,

     

    If you configure an ‘address’ field in the MapPress ‘geocoding’ section, MapPress should automatically create a map when the post is published or that field changes.

    If you don’t see that map, check that the field is actually populated – often this question comes up because people are using a custom fields plugin or theme that doesn’t store the data in a custom field.

    To tag posts I’d suggest using tags or categories.  There are examples in the documentation about how to query by tag/category.  You can test your query with the mashup shortcode, and one it’s working just enter that same query into the widget ‘query’ field to get it in the widget.

    If that doesn’t help please be more specific with your question and, if possible send a login to the blog using the contact form.

    #12148
    magnaromagna
    Participant

    Thank you for quick reply.

    I checked: the post have a custom field “address” right populated, but shows the map automatically only if I click on “Update post”. It works fine only after a manual update of the single post. But I have many and many posts. Is there a way to “force” the update of every post, so it display the mappress accordling with the custom fields?

    Thank you in advance

    #12149
    Chris
    Keymaster

    Hi,

    Do you mean you have existing address values in your posts?  If so, setting an address field in the MapPress configuration doesn’t retroactively create maps for the existing posts.

    You can update the posts by viewing the list of posts in the WordPress admin and then using ‘bulk actions’ -> ‘edit’ and clicking the ‘update’ button.  You can use the screen settings to view (and update) hundreds of posts at once that way.

    If you want to use PHP you can loop through your existing posts and trigger either the ‘save_post’ action or ‘mappress_update_meta’ action.  You can try the code below but be careful – if you add this to your functions.php, for example, it’ll run on every view of your blog so add it, create your maps and then remove it with FTP – and make a backup first:

      $wpq = new WP_Query('post_type=post&posts_per_page=-1&fields=ids');
      foreach($wpq->posts as $postid)
      	do_action('mappress_update_meta', $postid);
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.