Event Calendar for Wordpress with Gravity Forms

this is a post continuing the conversation from BuddyPress Community so i use jquery-ui first off, but if you just want today’s events, you don’t need to use it it also assumes that you are using Gravity Forms to have your users submit posts to a category called "events" with custom fields for event data. In this case i am storing the event date in a custom field to keep it separate from the post date...as they are not the same. so the first part is what is in my sidebar.php file

<?
$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
Post a comment
  1. David Brown

    Please could you send the whole code by email to me? Sorry, bit late finding this conversation, i hope its still possible. i have been looking around so much but this looks perfect!!! Thanks!!! my email is [email protected]

    • Matthew Price

      Hi David I am working on streamlining this a bit. I should be able to get this to you within a week Matt

  2. Tim Bowen

    Here's how to do it with the latest version of both plugins: Gravity Forms + Events Calendar Pro: How to submit events to Events Calendar Pro using Gravity Forms. http://creativeslice.com/tutorials/gravity-forms-events-calendar-submissions/

    • Matthew Price

      Always good to see other solutions. Good tutorial.

  3. Drew

    This sounds like exactly what I am looking for. I would love to have the whole code. My e-mail: [email protected] Thanks!

  4. Thomas

    Would love to see the whole code! Great work! An eMail would be much appreciated! :-))

  5. ThomazY

    A nice code, i am really impressed. Can you send me the whole code in my email? Thanks.

  6. shawn

    Thank you. Really looking forward to this one!

  7. Matt Price

    Hi Shawn I can get you the code in the next day or so. The rest of the site is member driven with gravity forms for all the articles, photos, and videos as well. Matt

  8. shawn

    Thank you so much for sharing this technique with us. I absolutely love working with gravity forums and combining it with your really cool tabbed widget is going to be a lot of fun. So far the only 'trick' feature I am doing with gravity is to allow my users to post their 'testimonies' which include photo's. Behind the scenes they are simply a custom post-type + taxonomies that are moderated prior to display. Nothing nearly this cool! I would love the full code emailed if possible. Guessing you can pull my email address from my profile field here. If not let me know and I'll paste it in. Once again, thank you so much

                        





Real Time Web Analytics ^