Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Custom single event template for the Espresso Events post type. This can be used in a Genesis child theme. Requires Event Espresso 4.
remove_action ( 'genesis_loop', 'genesis_do_loop' ); // Remove the standard loop
add_action( 'genesis_loop', 'custom_espresso_events_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_events_single_loop() {
if ( have_posts() ) :
// Start the Loop.
while ( have_posts() ) : the_post();
// Include the post TYPE-specific template for the content.
espresso_get_template_part( 'content', 'espresso_events' );
else :
// If no content, include the "No posts found" template.
espresso_get_template_part( 'content', 'none' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment