Hi bradgrafelman
Yeah sorry for the sparse info, but I did't want to complicate things up. However I'm using Wordpress as CMS but have created a custom calendar to meet my needs (display dates from Custom Field Values).
Hoping it might help ill walk you thru my thoughts and decisions.
The custom PHP calendar needs to be fead with following array which I am trying to reproduce. It's meant to put in manual, and I would like to create it dynamically.
$days = array(
"2"=>array($link,'class',$title),
"3"=>array($link,'class',$title),
"5"=>array($link,'class',$title)
);
$time = time();
$oldlocale = setlocale(LC_TIME, NULL); #save current locale
setlocale(LC_TIME, 'ch_DE'); #swiss
echo generate_calendar(date('Y', $time), $month, $days, 2, 'http://somelink', 1);
setlocale(LC_TIME, $oldlocale);
Basically this will call the generate_calendar function with the options set as above, whereas the the top arrays in the array $days will be highlighted in the calendar. This so far works.
Now I've set some custom fields in Wordpress which I have already called some other place and should work to with following code:
$calEvents = new WP_Query();
$calEvents->query('cat=4'); // wordpress query
if ($calEvents->have_posts()): while ($calEvents->have_posts()) : $calEvents->the_post(); // wordpress loop
global $more, $post;
$customdate = get_post_meta($post->ID, "date_value", true); // calling custom fields
list($jahr, $monat, $tag) = explode("-", $customdate); // extract only the day value
$singletag = intval($tag); // reformat from 02 to 2
$link = get_permalink();
$title = get_the_title();
$days = array( // this returns an array for each value instead one array with nested data as required
$singletag => array($link,'class', $title)
);
endwhile; else: endif; // end loop
As far as I'm concerned, the pulling in of the custom values is not the problem, rather the arranging of the data, or the loop.
Btw. I am aware that this is not a Wordpress forum, but I couldn't been been helped there, unfortunately.
I hope this gives more information on what I'm trying to achieve!
Thanks marcel