In my genesis child theme, I added 3 files
archive-espresso_venues.php
single-espresso_venues.php
content-espresso_venues.php
Now I can change the informations displayed. But my page isn’t complete. I can’t see anymore the Admin bar, or the footer.
Here is the 3 files
archive-espresso_venues.php
<?php
/**
* Template Name: Venue List
*
* This is template will display a list of your event venues
*
* Event Registration and Management Plugin for WordPress
*
* @ package Event Espresso
* @ author Seth Shoultes
* @ copyright (c) 2008-2014 Event Espresso All Rights Reserved.
* @ license https://eventespresso.com/support/terms-conditions/ * see Plugin Licensing *
* @ link http://www.eventespresso.com
* @ version EE4+
*/
get_header();
?>
<section id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<?php espresso_get_template_part( 'loop', 'espresso_venues' ); ?>
</div><!-- #content -->
</section><!-- #primary -->
<?php
get_sidebar( 'content' );
get_sidebar();
get_footer();
single-espresso_venues.php
<?php
remove_action ( 'genesis_loop', 'genesis_do_loop' ); // Remove the standard loop
add_action( 'genesis_loop', 'custom_espresso_venue_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' );
// Link https://eventespresso.com/topic/custom-template-2/
function custom_espresso_venue_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_venues' );
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) {
comments_template();
}
endwhile;
else :
// If no content, include the "No posts found" template.
espresso_get_template_part( 'content', 'none' );
endif;
}
genesis();
Now, I have changed “archive-espresso_venues.php” in
<?php
/**
* Template Name: Venue List
*
* This is template will display a list of your event venues
*
* Event Registration and Management Plugin for WordPress
*
* @ package Event Espresso
* @ author Seth Shoultes
* @ copyright (c) 2008-2014 Event Espresso All Rights Reserved.
* @ license https://eventespresso.com/support/terms-conditions/ * see Plugin Licensing *
* @ link http://www.eventespresso.com
* @ version EE4+
*/
get_header();
?>
<section id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<?php
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_venues' );
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) {
comments_template();
}
endwhile;
else :
// If no content, include the "No posts found" template.
espresso_get_template_part( 'content', 'none' );
endif;
?>
</div><!-- #content -->
</section><!-- #primary -->
<?php
get_footer();
I can’t really speak to whether or not it’s correct. It doesn’t follow the typical Genesis way of templating, but if you’re okay with that, more power to you.
Yes you right. Here is a better version. Thx a lot for your support Josh.
archive-espresso_venues.php
<?php
/**
* Template Name: Venue List
*
* This is template will display a list of your event venues
*
* Event Registration and Management Plugin for WordPress
*
* @ package Event Espresso
* @ author Seth Shoultes
* @ copyright (c) 2008-2014 Event Espresso All Rights Reserved.
* @ license https://eventespresso.com/support/terms-conditions/ * see Plugin Licensing *
* @ link http://www.eventespresso.com
* @ version EE4+
*/
remove_action ('genesis_loop', 'genesis_do_loop'); // Remove the standard loop
add_action( 'genesis_loop', 'custom_do_grid_venues_loop' ); // Add custom loop
function custom_do_grid_venues_loop() {
?>
<div class="page hentry entry">
<h1 class="entry-title"><?php get_the_title() ?></h1>
<div class="entry-content">
<?php
// Start the Loop.
while ( have_posts() ) : the_post();
// Include the post TYPE-specific template for the content.
espresso_get_template_part( 'content', 'espresso_venues' );
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) {
comments_template();
}
endwhile;
?>
</div><!-- end .entry-content -->
</div><!-- end .page .hentry .entry -->
<?php
}
genesis();
Viewing 6 reply threads
The support post ‘EE4, Custom Template Archive Venue, Genesis’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.