Created
March 4, 2019 18:51
-
-
Save joshfeck/635abb517b5674d5a4a412652c19a07d to your computer and use it in GitHub Desktop.
Move venue address so it appears before venue content. Event Espresso 4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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