Created
April 22, 2015 18:51
-
-
Save BeardedGinger/47b43c2be2ef86567465 to your computer and use it in GitHub Desktop.
Remove structured markup widget
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 | |
add_filter( 'tribe_events_event_classes', 'remove_markup_events_widget' ); | |
function remove_markup_events_widget() { | |
global $post, $wp_query; | |
$event_id = $post->ID; | |
if ( ! $event_id ) { | |
return ''; | |
} | |
$classes = array( 'vevent', 'type-tribe_events', 'post-' . $event_id, 'tribe-clearfix' ); | |
$tribe_cat_slugs = tribe_get_event_cat_slugs( $event_id ); | |
foreach ( $tribe_cat_slugs as $tribe_cat_slug ) { | |
if ( ! empty( $tribe_cat_slug ) ) { | |
$classes[] = 'tribe-events-category-' . $tribe_cat_slug; | |
} | |
} | |
if ( $venue_id = tribe_get_venue_id( $event_id ) ) { | |
$classes[] = 'tribe-events-venue-' . $venue_id; | |
} | |
if ( $organizer_id = tribe_get_organizer_id( $event_id ) ) { | |
$classes[] = 'tribe-events-organizer-' . $organizer_id; | |
} | |
// added first class for css | |
if ( ( $wp_query->current_post == 0 ) && ! tribe_is_day() ) { | |
$classes[] = 'tribe-events-first'; | |
} | |
// added last class for css | |
if ( $wp_query->current_post == $wp_query->post_count - 1 ) { | |
$classes[] = 'tribe-events-last'; | |
} | |
return $classes; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment