Skip to content

Instantly share code, notes, and snippets.

@wpflippercode
Created September 12, 2017 05:52
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Show Markers on Google Maps According to Post ID in the WordPress
add_filter('wpgmp_markers','wpgmp_markers',1,3 );
function wpgmp_markers($places,$map) {
global $post;
if( $post->ID == 1 ) {
$places = array_slice($places, 1,10);
} else if ($post->ID == 2) {
$places = array_slice($places, 10,10);
} else {
$places = array_slice($places, 20,10);
}
return $places;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment