Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Echos the single events page related events boxes, but without thumbnail images (essentially duplicates the
- * plugin's own single related event code, but runs sans-featured image).
- *
- * @param mixed $tag The specific tags you want it relating to.
- * @param mixed $category The specific categories you want it relating to.
- * @param int $count The number of related events to find.
- * @param mixed $blog What blog/site should they come from?
- * @param bool $only_display_related Should we show only related events if we don't find $count number of related ones?
- * @param string $post_type What post type are we finding related things in?
- * @return void.
- */
- function tribe_thumbless_single_related_events( $tag = false, $category = false, $count = 3, $blog = false, $only_display_related = true, $post_type = TribeEvents::POSTTYPE ) {
- $posts = tribe_get_related_posts( $tag, $category, $count, $blog, $only_display_related, $post_type );
- if ( is_array( $posts ) && !empty( $posts ) ) {
- echo '<h3 class="tribe-events-related-events-title">'. __( 'Related Events', 'tribe-events-calendar-pro' ) .'</h3>';
- echo '<ul class="tribe-related-events tribe-clearfix hfeed vcalendar">';
- foreach ( $posts as $post ) {
- echo '<li>';
- echo '<div class="tribe-related-event-info">';
- echo '<h3 class="tribe-related-events-title summary"><a href="'. get_permalink( $post->ID ) .'" class="url" rel="bookmark">'. get_the_title( $post->ID ) .'</a></h3>';
- if ( class_exists( 'TribeEvents' ) && $post->post_type == TribeEvents::POSTTYPE && function_exists( 'tribe_events_event_schedule_details' ) ) {
- echo tribe_events_event_schedule_details( $post );
- }
- if ( class_exists( 'TribeEvents' ) && $post->post_type == TribeEvents::POSTTYPE && function_exists( 'tribe_events_event_recurring_info_tooltip' ) ) {
- echo tribe_events_event_recurring_info_tooltip( $post->ID );
- }
- echo '</div>';
- echo '</li>';
- }
- echo '</ul>';
- }
- }
- remove_action('tribe_events_single_event_after_the_meta', 'tribe_single_related_events');
- add_action('tribe_events_single_event_after_the_meta', 'tribe_thumbless_single_related_events');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement