Support

Home Forums Event Espresso Premium Custom Event Post Templates not Working in 4.8.29

Custom Event Post Templates not Working in 4.8.29

Posted: January 12, 2016 at 3:36 pm

Viewing 11 reply threads


Burnt Orange Design

January 12, 2016 at 3:36 pm

Hi,
I updated one of my sites to version 4.8.29 today and now my custom event post template (content-espresso_events.php) is not working. I actually had to revert back to version 4.8.15 before I could get them working again. There may have been ones in between that worked properly, but that was the next one I had. 4.8.26 didn’t work properly either. Is there something I can do here to get it working again?

I’ve tried renaming the one in my theme folder while making changes to the content-espresso_events.php file in the public > Espresso_Arabica_2014 folder. No changes appeared no matter what I did.

I’ve tried replacing the previous file in my theme folder with the newer version in 4.8.29 and making changes to it, but nothing happened.

I don’t know what to do. It’s weird that nothing happens even when I make changes to the file in the plugin folder. Is there a new one that needs to be changed that’s different in this version?

yellowjacketvolleyballcamp.com

This is my previous content-espresso_events.php file…

<?php

global $post;
$event_class = has_excerpt( $post->ID ) ? ' has-excerpt' : '';
$event_class = apply_filters( 'FHEE__content_espresso_events__event_class', $event_class );
?>
<?php do_action( 'AHEE_event_details_before_post', $post ); ?>
	
			
					
				
				<?php if ( is_single() ) : ?>
				
				
				
				
				<article id="post-<?php the_ID(); ?>" <?php post_class( $event_class ); ?>>
					<div id="espresso-event-header-dv-<?php echo $post->ID;?>" class="espresso-event-header-dv">
						<?php espresso_get_template_part( 'content', 'espresso_events-thumbnail' ); ?>
						<?php espresso_get_template_part( 'content', 'espresso_events-header' ); ?>
					</div>
				
					<div class="espresso-event-wrapper-dv">
						<?php espresso_get_template_part( 'content', 'espresso_events-datetimes' ); ?>
						<?php espresso_get_template_part( 'content', 'espresso_events-details' ); ?>
						<?php espresso_get_template_part( 'content', 'espresso_events-tickets' ); ?>
						<?php espresso_get_template_part( 'content', 'espresso_events-venues' ); ?>
						<footer class="event-meta">
							<?php do_action( 'AHEE_event_details_footer_top', $post ); ?>
							<?php do_action( 'AHEE_event_details_footer_bottom', $post ); ?>
						</footer>
					</div>
				</article>
				
				<?php elseif ( is_archive() ) : ?>
				<div class="col-lg-3 col-md-3 col-sm-6">
				<article id="post-<?php the_ID(); ?>" <?php post_class( $event_class ); ?>>
					<div class="box-top"><div id="espresso-event-list-header-dv-<?php echo $post->ID;?>" class="espresso-event-header-dv">
						<?php espresso_get_template_part( 'content', 'espresso_events-thumbnail' ); ?>
						<?php espresso_get_template_part( 'content', 'espresso_events-header' ); ?>
					</div>
				
					
						<?php espresso_get_template_part( 'content', 'espresso_events-datetimes' ); ?>
						<?php espresso_get_template_part( 'content', 'espresso_events-tickets' ); ?></div>
						<div class="espresso-event-list-wrapper-dv box-desc">
						<?php espresso_get_template_part( 'content', 'espresso_events-details' ); ?>
						<?php espresso_get_template_part( 'content', 'espresso_events-venues' ); ?>
					</div>
				</article></div>
				<?php endif; ?>
				
				
		
	
<!-- #post -->
<?php do_action( 'AHEE_event_details_after_post', $post );


Lorenzo Orlando Caum

  • Support Staff

January 12, 2016 at 3:47 pm

Hello,

Was that done to re-order the event elements? For example, move the ticket selector below the event description? If so, there is a built-in feature that will handle that for you.

Rename any existing template files by adding an extra character such as a number or letter to the end. This deactivates them.

Then go to WP-admin –> Event Espresso –> Events –> Templates. Turn on the custom display order for the single event page and the events listing page.

Then adjust the order by doing a drag and drop. Your changes will then be immediately saved and you can view a single event page to see the new display that you setup.


Lorenzo


Burnt Orange Design

January 12, 2016 at 3:59 pm

Thanks Lorenzo. The main issue is that I’d added custom classes and also some enclosing divs after the is_archive() check…

<?php elseif ( is_archive() ) : ?>
<div class=”col-lg-3 col-md-3 col-sm-6″>
<article id=”post-<?php the_ID(); ?>” <?php post_class( $event_class ); ?>>
<div class=”box-top”><div id=”espresso-event-list-header-dv-<?php echo $post->ID;?>” class=”espresso-event-header-dv”>
<?php espresso_get_template_part( ‘content’, ‘espresso_events-thumbnail’ ); ?>
<?php espresso_get_template_part( ‘content’, ‘espresso_events-header’ ); ?>
</div>


Josh

  • Support Staff

January 12, 2016 at 4:53 pm

Hi there,

I can shed some light on the reason why you did not see any changes when you made edits directly to the content-espresso_events.php file in the plugin. It’s because Event Espresso 4 doesn’t use the file. It’s there as a reference can could be used if you make a call with get template part.

The best way to add the additional divs is add them in your theme’s archive.php file or in the template part that archive.php calls (depends on the structure of your theme) before and after it loads the_content(). All of the Event Content will get loaded in via the_content filter. If you only want those extra divs to appear when events are displayed, you wrap them in a conditional check for the espresso_events post type.


Burnt Orange Design

January 13, 2016 at 2:19 pm

Thanks Josh,
Can I get an example what you’re talking about?


Burnt Orange Design

January 13, 2016 at 2:24 pm

I have 5 websites designed using the same content-espresso_events.php file and need a good system of switching things over before I update them to the newest version of EE4.


Josh

  • Support Staff

January 13, 2016 at 2:37 pm

The example I give you will only be useful if I know what your theme’s archive.php template and its templates part look like.


Burnt Orange Design

January 13, 2016 at 2:55 pm

I don’t see an archive.php file in my theme.


Burnt Orange Design

January 13, 2016 at 2:59 pm

I’m assuming this article is no longer relevant to newer versions of EE4. It’s what I used, but no longer works…

https://eventespresso.com/wiki/build-custom-espresso-event-post-templates-genesis/


Josh

  • Support Staff

January 13, 2016 at 3:25 pm

That guide is still valid and will work as long as you’re using a Genesis theme.


Burnt Orange Design

January 13, 2016 at 3:27 pm

Ok thanks. I don’t see an archive.php file in my theme.


Josh

  • Support Staff

January 13, 2016 at 3:32 pm

WordPress will use the index.php file if no archive.php template is found:

http://wphierarchy.com/

Viewing 11 reply threads

The support post ‘Custom Event Post Templates not Working in 4.8.29’ 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.

Event Espresso