public
Last active

A cool example of what your locations post type archive page could look like

  • Download Gist
archive-wpseo_locations.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
<?php
/**
* Template for displaying a map on the locations post-type archive page.
*
* @package Twenty_Twelve
* @subpackage Local SEO for WordPress Archive page template
* @author Joost de Valk
*/
 
get_header();
 
if ( function_exists( 'yoast_breadcrumb' ) ) {
yoast_breadcrumb('<p id="breadcrumbs">','</p>');
}
 
?>
 
<div id="primary" class="site-content">
<div id="content" role="main">
<h1>Locations</h1>
<br/>
<?php
$args = array(
'id' => 'all',
'width' => 960,
'height' => 600
);
echo wpseo_local_show_map( $args );
?>
 
</div><!-- #content -->
</div><!-- #primary -->
 
<?php get_footer(); ?>

Note that the Local SEO plugin will output the links to the locations inside the map div, so that when the map isn't loaded, the locations can still be reached. This also makes sure Google will be able to find them.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.