Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ( !defined('ABSPATH') ) { die('-1'); } ?>
- <?php
- function asdf_check_first_friday( $date_to_check, $year, $month ) {
- // get first friday:
- $this_months_friday = new DateTime( 'first friday ' . $year . "-" . $month );
- if( strtotime( $this_months_friday->format( 'M j' )) == strtotime( $date_to_check )) :
- //echo "first friday!!!";
- return true;
- else : // aint first friday chief
- return false;
- endif;
- }
- ?>
- <?php $day = tribe_events_get_current_month_day(); $rr = 0; ?>
- <?php if ($day['date'] != 'previous' && $day['date'] != 'next') : ?>
- <!-- Day Header -->
- <div id="tribe-events-daynum-<?php echo $day['daynum'] ?>">
- <a href="<?php echo tribe_get_day_link($day['date']) ?>"><?php echo $day['daynum'] ?></a>
- </div>
- <?php $date_parts = explode( '-', $day['date'] ); // or split()
- if( asdf_check_first_friday( $day['date'], $date_parts[0], $date_parts[1] )) :
- ?><span class="its-first-friday-grid" style="display:none;">First Friday<br><a href="<?php echo tribe_get_day_link($day['date']) ?>">View Events</a></span>
- <?php else : ?>
- <!-- Events List -->
- <?php while ($day['events']->have_posts()) : $day['events']->the_post(); ?>
- <?php tribe_get_template_part( 'month/single', 'event' ); ?>
- <?php endwhile; ?>
- <?php endif; ?>
- <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement