Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Created April 19, 2016 21:13
Show Gist options
  • Save joshfeck/479ca9db5d450a4ade6a9a63002ac92d to your computer and use it in GitHub Desktop.
Save joshfeck/479ca9db5d450a4ade6a9a63002ac92d to your computer and use it in GitHub Desktop.
Single Venue template for Event Espresso 4 venues for use in a Genesis child theme.
<?php
remove_action ( 'genesis_loop', 'genesis_do_loop' ); // Remove the standard loop
add_action( 'genesis_loop', 'custom_espresso_venues_single_loop' ); // Add custom loop
// Optional: Remove post info
remove_action( 'genesis_before_post_content', 'genesis_post_info' );
remove_action( 'genesis_after_post_content', 'genesis_post_meta' );
function custom_espresso_venues_single_loop() {
if ( have_posts() ) :
// Start the Loop.
while ( have_posts() ) : the_post();
// Include the post TYPE-specific template for the content.
?>
<div id="espresso-venue-header-dv-<?php echo $post->ID;?>" class="espresso-venue-header-dv">
<?php espresso_get_template_part( 'content', 'espresso_venues-thumbnail' ); ?>
<?php espresso_get_template_part( 'content', 'espresso_venues-header' ); ?>
</div>
<div class="espresso-venue-wrapper-dv">
<?php
global $post;
if ( espresso_venue_has_address( $post->ID )) :
?>
<div class="venue-location">
<h3 class="venue-address-h3 ee-venue-h3">
<span class="dashicons dashicons-location-alt"></span>
<?php _e( 'Location', 'event_espresso' ); ?>
</h3>
<span class="small-text"><strong><?php _e( 'Address:', 'event_espresso' ); ?></strong></span><?php espresso_venue_address( 'inline', $post->ID ); ?>
<div class="clear"></div>
<?php endif; ?>
</div>
<?php espresso_get_template_part( 'content', 'espresso_venues-details' );
if ( espresso_venue_has_address( $post->ID )) :
?>
<div class="venue-location">
<div class="venue-gmap"><?php espresso_venue_gmap( $post->ID ); ?></div>
<div class="clear"></div>
</div>
<?php endif; ?>
<footer class="venue-meta">
<?php do_action( 'AHEE__content_espresso_venues_template__footer_top', $post ); ?>
<?php do_action( 'AHEE__content_espresso_venues_template__footer_bottom', $post ); ?>
</footer>
</div>
<?php
endwhile;
else :
// If no content, include the "No posts found" template.
espresso_get_template_part( 'content', 'none' );
endif;
}
genesis();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment