Skip to content
Ben Huson edited this page May 29, 2013 · 10 revisions

Description

Usage

<?php wpgeo_map( $query ); ?>

Default Usage

For a full list of query parameters see get_posts().

<?php
$wp_geo_options = get_option( 'wp_geo_options' );
$query = array(
	'width'           => $wp_geo_options['default_map_width'],
	'height'          => $wp_geo_options['default_map_height'],
	'type'            => $wp_geo_options['google_map_type'],
	'polylines'       => $wp_geo_options['show_polylines'],
	'polyline_colour' => $wp_geo_options['polyline_colour'],
	'align'           => 'none',
	'numberposts'     => -1,
	'posts_per_page'  => -1,
	'post_type'       => 'post',
	'post_status'     => 'publish',
	'orderby'         => 'post_date',
	'order'           => 'DESC',
	'markers'         => 'large',
	'markers'         => 'large',
	'offset'          => 0,
	'category'        => null,
	'include'         => null,
	'exclude'         => null,
	'meta_key'        => null,
	'meta_value'      => null,
	'post_mime_type'  => null,
	'post_parent'     => null
);
?>

Parameters

$query
(array) List of query parameters. For a full list see get_posts().
Default: Same as get_posts()

$options
(array) (Optional) List of options. Currently not used.

Return Value

Output is echoed.

Examples

Category Map

Output all posts from a category with ID 4.

<?php
wpgeo_map( array(
	'cat' => 4
) );
?>

Current Category Map

Output all posts from the current category.

<?php
wpgeo_map( array(
	'cat' => get_query_var( 'cat' )
) );
?>

Source File

wpgeo_map() is located in includes/templates.php