Here is the code to use featured images on maps. Works with custom content type manager. You can use wp_query to add more elements to the query. Specify your post type then add this to functions:
function my_wpgeo_markers( $markers ) {
$custom = new WP_Query();
$custom->query(‘post_type=custom_post_type_name&posts_per_page=-1’);
$i = 1;
while ($custom->have_posts()) : $custom->the_post();
$title = get_the_title();
$content = get_the_content();
$slug = basename(get_permalink());
$slug = str_replace(“-“, “_”, $slug);
$post_id = get_the_ID();
$thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), ‘thumbnail’ );
$url = $thumb[‘0’];
$thumb_shadow = “add_image_here.png”;$imageurl = get_post_meta( $post_id, ‘first_gallery_image_meta_box’, TRUE );
$markers[$i] = new WPGeo_Marker(
$slug, // custom post slug
$title, // readable marker text
$content, // info text
30, 30, 10, 34, // width, height, anchorx, anchor y
$url, //image url
$thumb_shadow //image shadow
);$i++;
endwhile;
return $markers;
}
add_action( ‘wpgeo_markers’, ‘my_wpgeo_markers’ );
If any content is missing the code will break so you might want to include if statements if fields are empty within the function.
ie:
if ($url == “”) {
$url = “default_image_link.png
}
Here is the code for the template page: