Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Created March 4, 2019 18:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshfeck/635abb517b5674d5a4a412652c19a07d to your computer and use it in GitHub Desktop.
Save joshfeck/635abb517b5674d5a4a412652c19a07d to your computer and use it in GitHub Desktop.
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