<? $today = date('m/d/Y'); $tomorrow = mktime(0, 0, 0, date('m'), date('d')+1, date('y')); $tomorrowCompare = date('m/d/Y', $tomorrow); ?>This next part is still in the sidebar.php
// This sets up the buttons with the days that will reveal the events that match the date <ul> <li><a href="#tabs-1"><? echo date('D'); ?><br><span><? echo date('j'); ?></span></a></li> <li><a href="#tabs-2"><? echo date('D', $tomorrow); ?><br><span><? echo date('j', $tomorrow); ?></span></a></li> </ul> <? // this is still in the sidebar.php file // the '1' is the ID of the jquery tab. you would increment this number for as many days that you want to show at a time. also changing "$today" to "$tomorrowCompare"...from above generate_week_events('1', $today); generate_week_events('2', $tomorrowCompare); ?>the function then compares the date fed in as an argument to the date in the custom field. if there is a match, then it shows the corresponding events. i just placed this in my functions.php of my theme
<? function generate_week_events($id, $date) { global $post; ?>
<? //9 here is the Events Category for this site it was implemented on and gets all posts where with a meta_value of the date fed in $args=array('cat'=> 9, 'meta_value'=> $date); query_posts($args); // Here I just split the $date at the "/". the client at one point wanted the date spelled out in the list as "January 1st, 2010" but later did not, but i kept it here for your reference if you want it. $r_date = explode('/', $date); $mk_date = mktime( 0,0,0, date($r_date[0]), date($r_date[1]), date($r_date[2])); $print_date = date('F jS Y', $mk_date); // echo $print_date; if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<? the_title(); ?>
<? $location = get_post_meta($post->ID, 'event location', true); if ($location!='') { echo "@" . $location; } ?> </div> <? endwhile; else: endif; ?> <? wp_reset_query(); ?> </div> <? } ?> this is the basic concept if you want the full code lemme know and i can email it to you Demo here in sidebar Any questions feel free Matt
<? $location = get_post_meta($post->ID, 'event location', true); if ($location!='') { echo "@" . $location; } ?> </div> <? endwhile; else: endif; ?> <? wp_reset_query(); ?> </div> <? } ?> this is the basic concept if you want the full code lemme know and i can email it to you Demo here in sidebar Any questions feel free Matt