Support

Home Forums Event Espresso Premium Hooks/Action Filters for Single Event View

Hooks/Action Filters for Single Event View

Posted: November 4, 2014 at 9:01 pm


steeleb88

November 4, 2014 at 9:01 pm

Could someone please provide me the correct hook/action filters to use for the following sections in a single event view:

– Ticket selector (FHEE__EE_Ticket_Selector__display_ticket_selector__template_path, correct?)
– The Event Venue location (wrapped in the “espresso-venue-dv” div)
– The ticket date/times (wrapped in the “event-datetimes” div)
– The event description (which i believe is just part of the post content). although im not fond of its display in the markup, could i change this?


Josh

  • Support Staff

November 5, 2014 at 12:49 pm

Hi there,

The FHEE__EE_Ticket_Selector__display_ticket_selector__template_path will let you load in an alternate version of the ticket_selector_chart.template.php from a location you specify. Here’s an example of how to use the filter:

// lets you load the ticket selector template from another location

add_filter ('FHEE__EE_Ticket_Selector__display_ticket_selector__template_path', 'my_custom_ticket_selector_template_location');

function my_custom_ticket_selector_template_location(){
    return get_stylesheet_directory() . '/ticket_selector_chart.template.php';
}

With the other three items, I can point you to the actual template files that Event Espresso 4 uses. There may or may not be hooks there you can use for what you’re trying to do. The templates are located in /public/Espresso_Arabica_2014.

content-espresso_events-venues.php for Venue location
content-espresso_events-datetimes.php for date times
content-espresso_events-details.php for the description

Another approach would be to copy over the Espresso Arabica child theme from the /public folder and convert markup to match your theme, then you can change the markup of those sections regardless of whether there is a filter there or not.


steeleb88

November 6, 2014 at 9:19 am

Thanks, Josh. So I can copy over the Espresso_Arabica_2014 folder to my theme and espresso will use the files in there instead?


Josh

  • Support Staff

November 6, 2014 at 9:43 am

Yes you can. However please be aware that you’ll need to alter the markup to match your WordPress theme in the templates that are prefixed with loop-, archive-, and single-. The exception to this rule is twentyfourteen, because Arabica_2014 is based on the twentyfourteen theme.


steeleb88

November 12, 2014 at 3:47 pm

Hey Josh, I’ve just now had a chance to tinker with this. I’ve copied over Espresso_Arabica_2014 into my theme and made a change in content-espresso_events-venues.php to verify and it doesn’t seem to be using the file in my theme. I’m using the wp-starter theme, which is a child theme of wp-forge. Does this need to go in the parent theme to work? Also, I didn’t copy the entire public folder in event-espresso-core, just the arabica_2014. Does the public folder need to be included also?


Josh

  • Support Staff

November 12, 2014 at 5:49 pm

Hi there,

The files within the Espresso_Arabica_2014 folder (not the whole folder) should be copied into the child theme folder.


steeleb88

November 13, 2014 at 3:46 pm

I’ve moved content-espresso_events.php to my theme root folder, and when viewing a single event, single.php does not use this template because get_post_format() does not return anything. If I put this code in single.php:


if($post_type == 'espresso_events'){
    get_template_part( 'content', 'espresso_events' );
}else{
    get_template_part( 'content', get_post_format() );
}

It will use content-espresso_events.php in my theme, however, on the single event page, the ticket selector, date/times, and google map are all spit out twice. What am i doing wrong?


steeleb88

November 13, 2014 at 5:56 pm

Scratch that question, I’ve gone a different route. How can I grab the grab the time and date for a particular ticket? For example, in the ticket selector template, I’m adding another column to the ticket selector table for Date and Time.

In the ticket loop:


foreach ( $tickets as $TKT_ID => $ticket ) {
   $ticket->get_date();
   $ticket->get_time();
}

what is the $field parameter supposed to be for those function calls?


Josh

  • Support Staff

November 13, 2014 at 6:43 pm

Hi there,

One thing to keep in mind is tickets can allow access to multiple date times. So another loop may be in order. If you look further down the ticket selector template, you’ll find another loop that handles the date times. This is the section that gets displayed in the extra “show details” section that displays more details about the tickets.

The support post ‘Hooks/Action Filters for Single Event View’ 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