Reply To: New POI fields do not show on single post map, but do show on mashup

Home › Forums › MapPress Support › New POI fields do not show on single post map, but do show on mashup › Reply To: New POI fields do not show on single post map, but do show on mashup

#15932
Chris
Keymaster

    Hi,

    The problem is that the plugin only sets $poi->postid for mashups. For individual maps you’ll need to take the current post ID from the global $post.

    I’d like to to get this fixed, since it’s inconsistent – but until then you can use something like this:

    
    <?php global $post; ?>
    <?php $postid = ($poi->postid) ? $poi->postid : $post->ID; ?>
    <div><?php echo get_the_post_thumbnail($postid); ?></div>
    <strong>Grid Reference:</strong> <?php echo get_post_meta($postid, 'wpcf-grid_reference', true); ?><br>
    <strong>Recorder's Name:</strong> <?php echo get_post_meta($postid, 'recorder_name', true); ?><br>
    <strong>Sighting Date:</strong> <?php echo get_post_meta($postid, 'sighting_date', true); ?><br>