hi there, can you post a functional example of theme integration?
thanks
hi there, can you post a functional example of theme integration?
thanks
Oh, that would be helpful.
I tried code something for single.php site, but it doesn't work ( post id is 0 div with map id gmap_0_0) and map is showing nothing besides blue.
<?php
if (is_single()) {
$post->ID = get_query_var('p');
if (class_exists('Geotag')) {
Geotag::the_geotag('print_map', array('post_id' => ''.$post->ID));
}
}
?>
Where am i wrong?
Hi,
to display a simple map with all of your geotagged posts you can try the following code:
if (class_exists('Geotag')) {
$options = array(
'width' => '100%',
'height' => '400px',
'visible' => true,
'marker_query' => 'numberposts=-1',
'readexiftags' => true,
'init_on_pageload' => true
);
Geotag::the_geotag('print_map', $options);
}And a map for single post?
Something like
'marker_query' => 'numberposts=1&cat=2'
Please have a look at this page: http://codex.wordpress.org/Function_Reference/WP_Query
i've added a couple of lines to geotag.php, the_geotag function, line 2479, plugi version 2.0:
[Code moderated as per the Forum Rules. Please use the pastebin]
notice the elseif condition added. thats all. works for my single post template, when calling like this:
if (class_exists('Geotag')) {
$options = array(
'width' => '100%',
'height' => '400px',
'visible' => true,
'readexiftags' => true,
'init_on_pageload' => true,
'post_id' => ''.$post->ID
);
Geotag::the_geotag('print_map', $options);
}enkosynthesys is it possible to rewrite what you wrote some how? I think the moderator deleted exactly what you were trying to describe, and the "elseif" command is not in your post.
additionally, does anyone know how to post a generic gmap (like those examples state above), but limit it to perhaps the last 5 posts?
Thanks again.
This topic has been closed to new replies.