Create a custom taxonomy that will be used to create and filter markers in a Google Map

Here’s a fully working example to get you started. Register the “marker” taxonomy register_taxonomy( ‘marker’, ‘post’, array( ‘hierarchical’ => false, ‘update_count_callback’ => ‘_update_post_term_count’, ‘label’ => __( ‘Markers’, ‘textdomain’ ), ‘labels’ => array( ‘name’ => __( ‘Markers’, ‘textdomain’ ), ‘singular_name’ => __( ‘Marker’, ‘textdomain’ ), ‘menu_name’ => _x( ‘Markers’, ‘Admin menu name’, ‘textdomain’ ), ‘search_items’ => … Read more

Display a post map on a blank/new page

After some more Googling… New single.php looks like this: <?php get_header(); global $wp_query; if ( ! isset( $wp_query->query_vars[‘map’] ) ) { if (have_posts()) : while (have_posts()) : the_post(); the_title(); the_content(); endwhile; endif; ?> <p><a href=”https://wordpress.stackexchange.com/questions/31442/<?php echo get_permalink(); ?>?map=yes”>Map</a></p> <?php } else { ?> <div id=”map-canvas”></div> <?php } get_footer(); And functions.php like this: add_filter(‘query_vars’, ‘parameter_queryvars’ ); … Read more