Support

Home Forums Event Espresso Premium Modify Event Archives Page

Modify Event Archives Page

Posted: December 2, 2017 at 11:08 am

Viewing 7 reply threads


learnrobotics

December 2, 2017 at 11:08 am

Hello, I’m trying to add Date & Time and a Registration Button to my Event Archives page.

Right now it looks like this: https://drive.google.com/open?id=1_wp43WmcyNf3oPKDjloRHyTxPO4mHstq

I want it to look like this:https://drive.google.com/open?id=1BNMr60yb9p15TDEj3f5MSTxhssSKKVgd

I try to change the Template settings under events to show Date/Time and Ticket Selector, but nothing happens to my event page. It says like the original picture regardless of my selection.

How do I go about making these updates? I’ve searched the forums and found a post from 2015, but want to know if there is a better way to do it, now that it’s 2017…

I’m not afraid to work in the code, I just need someone to point me in the direction of which file(s) to look in and provide an example.

Thanks for your help!


Tony

  • Support Staff

December 4, 2017 at 3:44 am

Hi there,

Which theme are you using on the site?

There is 2 sets of settings on the template setting page, are you editing the settings under the ‘Event list pages’ section? – http://take.ms/nFM8M


learnrobotics

December 4, 2017 at 7:03 am

I’m using the Hestia Theme.

Yes, I’ve picked the settings under the Event list pages section. Regardless of what I choose, I can’t get the Date/Time or even ticket selector to appear…


Josh

  • Support Staff

December 4, 2017 at 10:25 am

Hi there,

This is actually related to something that’s a little different about the Hestia theme. Here’s the relevant code from the Hestia theme’s template-parts/content.php file, starting on line 45:

<?php
$hestia_more = strpos( $post->post_content, '<!--more' );
if ( $hestia_more ) :
	echo get_the_content();
else :
	echo get_the_excerpt();
endif;
?>

Normally a WP theme will just do this instead:
<?php the_content(); ?>

Event Espresso 4 actually relies on there being a call to the_content(), but that’s not happening with the Hestia theme.

You can change the above code from Hestia theme to be as follows:

<?php
$hestia_more = strpos( $post->post_content, '<!--more' );
if ( $hestia_more ) :
	echo get_the_content();
elseif ( is_post_type_archive( 'espresso_events' )) :
	the_content();
else :
	echo get_the_excerpt();
endif;
?>

We recommend setting up a child theme and then you can copy the modified template to the child theme’s /template-parts/ folder and you modification will not be overwritten on a theme update.


learnrobotics

December 5, 2017 at 10:22 am

Okay, I’m going to try that out today. Let me get back to you before you close this thread.


Josh

  • Support Staff

December 5, 2017 at 10:40 am

The topics self-close after 2 weeks of inactivity. You can start a new topic if you don’t come back until after 2 weeks.


learnrobotics

December 5, 2017 at 10:48 am

Wow! Looks like I got it working.

Couple of modifications I’d like to do:

1. Venue info: Right now I have everything about the venue printing out (which is just way too much info for this page). Can I just print out the Venue Name and have it linked to its respective venue page? This will save space and make the page look cleaner.

2. View More button – how do I change the text of this button? I’d like it to say “Register”

Thanks so much, this has been pretty easy so far.


Josh

  • Support Staff

December 6, 2017 at 12:36 pm

Yes you can and it involves making some template edits. First you’ll copy over the content-espresso_events-venues.php file from the Event Espresso plugin (located in the public/Espresso_Arabica_2014 folder). You’ll copy that file into your child theme.

Then after line 20 you’ll add:
<?php if ( is_single() ) : ?>

Then you’ll add one more endif statement around line 57 or so (there should be 2 already, you’ll add one more)
<?php endif; ?>

What that will do is make it so everything inside that if statement will display only if it’s a single event page.

2. View More button – how do I change the text of this button? I’d like it to say “Register”

One way would be to change the settings in Event Espresso > Events > Templates under Event list and set it to display the ticket selector.

Or you can use a translation function as outlined here:

https://eventespresso.com/wiki/how-to-change-wording-with-poedit/#custom-function

Viewing 7 reply threads

The support post ‘Modify Event Archives Page’ 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