The following filters are no longer recommended as a way to adjust the order of the event elements in Event Espresso 4. As of Event Espresso 4.8.21, there is a template re-order option in WP-admin --> Event Espresso --> Events --> Templates. The Templates screen can be used to reorder the events elements on the single event page as well as the events listing page.
<?php
//* Do NOT include the opening php tag
add_filter ('the_content', 'my_remove_event_datetimes', 100 );
// remove datetimes
function my_remove_event_datetimes( $content ) {
if ( 'espresso_events' == get_post_type() && is_singular() && !post_password_required() ) {
remove_filter( 'the_content', array( 'EED_Event_Single', 'event_datetimes' ), 110 );
add_filter( 'the_content', 'my_add_event_datetimes', 122);
}
return $content;
}
// add datetimes after the tickets
function my_add_event_datetimes( $content ) {
return $content . EEH_Template::locate_template( 'content-espresso_events-datetimes.php' );
}
add_filter ('the_content', 'my_remove_event_tickets', 100 );
// remove tickets
function my_remove_event_tickets( $content ) {
if ( 'espresso_events' == get_post_type() && is_singular() && !post_password_required() ) {
remove_filter( 'the_content', array( 'EED_Event_Single', 'event_tickets' ), 120 );
add_filter( 'the_content', 'my_add_event_tickets', 121);
}
return $content;
}
// add tickets after the content
function my_add_event_tickets( $content ) {
return $content . EEH_Template::locate_template( 'content-espresso_events-tickets.php' );
}
The following sample files are no longer recommended as a way to adjust the order of the event elements in Event Espresso 4. As of Event Espresso 4.8.21, there is a template re-order option in WP-admin --> Event Espresso --> Events --> Templates. The Templates screen can be used to reorder the events elements on the single event page as well as the events listing page.
Here is an alternative version:
This requires creating a template file. An SFTP or FTP client (e.g. FileZilla, Cyberduck, Transmit) will also be needed.
http://cl.ly/code/2c0u34402f2Z
Login to your site with an SFTP or FTP client. Cyberduck and FileZilla are free options. Using a Mac? Try Transmit
Browse to your themes folder:
Upload the file that you downloaded in step 1 to your themes folder.
Locate a page.php file and duplicate it.
Rename the duplicated file to single-espresso_events.php
Open the new single-espresso_events.php file for editing and look for the line that calls the content for the page. Then change it to the following and save changes:
This sets the new theme template file to retrieve the event information including the ticket selector.