Skip to content

Instantly share code, notes, and snippets.

@cliffordp
Created September 19, 2016 22:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cliffordp/4699d8373ea15967307374e51cad33c5 to your computer and use it in GitHub Desktop.
Save cliffordp/4699d8373ea15967307374e51cad33c5 to your computer and use it in GitHub Desktop.
The Events Calendar: Show map for each event in List View -- https://cl.ly/1g2R2f3Q1k2Y
<?php
/**
* The Events Calendar: Show map for each event in List View
* Video preview: https://cl.ly/1g2R2f3Q1k2Y
*
* By Nico 2016-08-09
* From https://gist.github.com/cliffordp/4699d8373ea15967307374e51cad33c5
*/
function tribe_print_map_in_list_view ( ) {
// bail if not in list view
if ( ! class_exists('Tribe__Events__Embedded_Maps' ) || ! function_exists( 'tribe_is_list_view' ) || ! tribe_is_list_view() ) return false;
$maps = Tribe__Events__Embedded_Maps::instance();
echo $maps->get_map( null, null, null, false );
}
add_action ( 'tribe_events_after_the_meta', 'tribe_print_map_in_list_view' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment