Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Move venue address so it appears before venue content. Event Espresso 4
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action('pre_get_posts', 'my_change_venue_details');
function my_change_venue_details() {
global $post;
if ($post instanceof WP_Post && $post->post_type == 'espresso_venues' && is_single()) {
remove_filter('the_content', array(EED_Venue_Single::instance(), 'venue_location'), 110, 1);
add_filter('the_content', 'add_venue_details_in_custom_order', 120, 1);
}
}
function add_venue_details_in_custom_order($content) {
$content = EEH_Template::locate_template('content-espresso_venues-location.php')
. '<br>'
. $content;
return $content;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.