get_event_taxonomy() ) ) { $cat = get_term_by( 'slug', get_query_var('term'), $tribe_ecp->get_event_taxonomy() ); $eventCat = (int) $cat->term_id; $eventPosts = tribe_get_events( array( 'eventCat' => $eventCat, 'time_order' => 'ASC', 'eventDisplay'=>'month' ) ); } // not in a cat else { $eventPosts = tribe_get_events(array( 'eventDisplay'=>'month' )); } $daysInMonth = isset($date) ? date("t", $date) : date("t"); $startOfWeek = get_option( 'start_of_week', 0 ); list( $year, $month ) = split( '-', $tribe_ecp->date ); $date = mktime(12, 0, 0, $month, 1, $year); // 1st day of month as unix stamp $rawOffset = date("w", $date) - $startOfWeek; $offset = ( $rawOffset < 0 ) ? $rawOffset + 7 : $rawOffset; // month begins on day x $rows = 1; $monthView = tribe_sort_by_month( $eventPosts, $tribe_ecp->date ); ?> daysOfWeek) + $startOfWeek; $n++ ) { $dayOfWeek = ( $n >= 7 ) ? $n - 7 : $n; echo ''; } ?> "; } // output this month $days_in_month = date("t", intval($date)); for( $day = 1; $day <= $days_in_month; $day++ ) { if( ($day + $offset - 1) % 7 == 0 && $day != 1) { echo "\n\t"; $rows++; } // Var'ng up days, months and years $current_day = date_i18n( 'd' ); $current_month = date_i18n( 'm' ); $current_year = date_i18n( 'Y' ); $date = "$year-$month-$day"; if ( $current_month == $month && $current_year == $year) { // Past, Present, Future class if ($current_day == $day ) { $ppf = ' tribe-events-present'; } elseif ($current_day > $day) { $ppf = ' tribe-events-past'; } elseif ($current_day < $day) { $ppf = ' tribe-events-future'; } } elseif ( $current_month > $month && $current_year == $year || $current_year > $year ) { $ppf = ' tribe-events-past'; } elseif ( $current_month < $month && $current_year == $year || $current_year < $year ) { $ppf = ' tribe-events-future'; } else { $ppf = false; } echo ""; } // skip next month while( ($day + $offset) <= $rows * 7) { echo ""; $day++; } ?>
' . $tribe_ecp->daysOfWeekShort[$dayOfWeek] . '
" . display_day_title( $day, $monthView, $date ) . "\n"; echo display_day( $day, $monthView ); echo "
"; if( function_exists('tribe_get_linked_day') && count( tribe_get_events( array( 'start_date' => $date, 'end_date' => $date, 'eventDisplay' => 'all') ) ) > 0 ) { $return .= tribe_get_linked_day($date, $day); // premium } else { $return .= $day; } $return .= "'; $return .= ""; return $return; } function display_day( $day, $monthView ) { global $post; $output = ''; $posts_per_page = tribe_get_option( 'postsPerPage', 10 ); for ( $i = 0; $i < count( $monthView[$day] ); $i++ ) { $post = $monthView[$day][$i]; setup_postdata( $post ); $eventId = $post->ID.'-'.$day; $start = tribe_get_start_date( $post->ID, false, 'U' ); $end = tribe_get_end_date( $post->ID, false, 'U' ); $cost = tribe_get_cost( $post->ID ); $address = tribe_get_address( $post->ID ); $city = tribe_get_city( $post->ID ); $state = tribe_get_state( $post->ID ); $province = tribe_get_province( $post->ID ); $country = tribe_get_country( $post->ID ); ?>
>
"; } } } ?>