Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter('wpdh_get_active_post_header', 'tribe_single_event_custom_headers');
- function tribe_single_event_custom_headers($header) {
- // Bow out if a header was found or if this is not a single event query
- if (!empty($header) || !(is_singular() && tribe_is_event_query())) return $header;
- // Try to pull the actual single event post or bow out
- global $wp_query;
- if (count($wp_query->posts) !== 2 || !isset($wp_query->posts[0])) return $header;
- $event = $wp_query->posts[0];
- // Determine if we've got a specific header image to show
- $post_header = get_post_meta($event->ID, '_wpdh_display_header', true);
- return $post_header;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement