24 Comments

  1. bumpershine says:

    It doesn’t really handle recurring events at this point, though if you’re handy with the PHP you could probably add some code in there to deal with them in no time at all. It’s actually a great suggestion and I think I’ll probably add it in to a future release (whenever that may be).

  2. non says:

    Great code, thanks a lot.

    I was able to do the part with the sorting by custom field, but I didn’t knew how to display only the upcoming events.

    1. bumpershine says:

      Not quite sure what you mean by your comment, but feel free to send me an email me about your issue and I’ll see what I can do.

  3. non says:

    Hi there. I mean I was able to do a part myself, but I never figured out how to display only the upcoming events, but thanks to your code now it’s very easy. Thanks again.

  4. Ed says:

    This is a really great mashup. Thanks a lot.

    One thing, I was able to get the main Upcoming Events page to show up and populate properly, but I wasn’t sure how you created the small right hand “Upcoming Events” sidebar list that links to the main Upcoming Events page.

  5. bumpershine says:

    The sidebar code more or less makes use of the same code that is in the main events page, I’ll post an update soon.

  6. bumpershine says:

    I added an addendum to this post, dates should actually be formatted like “yyyy/mm/dd” for proper ordering.

  7. Lariza says:

    Hi, this looks like exactly what I’m looking for, thanks! 🙂 I have one question – is it possible to show the present event (exhibition in my case) somewhere? I should have exhibitions page which shows the present exhibition and links to the past and becoming exhibitions.

  8. Lariza says:

    Actually I think I already found a solution, I just have to modify line 83 to if($show_date = $today), that way it would show only the current exhibition, right?

  9. Lariza says:

    ah, the code doesn’t show up correctly here. anyway the idea was to compare today’s date both to the end date and start date. If it is smaller (=) than start date it will show the post.

    1. Lariza says:

      sorry for this mess, even the “less than” and “greater than” marking doesn’t show up here. Anyway, my modified code shows the event only if the start date is less than/equals today’s date AND the end date is greater than/equals today’s date. Simple really.

      1. bumpershine says:

        Hi Lariza,

        Sorry I have missed your comments up until now, but it sounds like you got it figured out. Can you send me a link to your site?

  10. Thanks for the post. I used some information here to help me find the solution for a project I’m working on (though I did it a bit differently).

    I noticed you are using a comparison in your PHP loop to pick out all items in the future. You can do this much more efficiently by adding a comparison to your query_posts string:
    .’meta_compare=>=&meta_value=’. date(‘Y/m/d’, current_time(‘timestamp’)
    This will only return posts with date greater than or equal to the current date, so you won’t have all of the earlier posts in your loop. There could end up being a lot of old posts after a while.

    1. bumpershine says:

      Thanks Toby, great suggestion.

  11. Anca says:

    Wow, this is great! I’ve been working on and off on an event calendar, and now, I’m finally going to finish it. Thanks for the sample, and thanks to Toby for the database query optimization!

    1. bumpershine says:

      Anca, please send me a link when you get it up.

  12. Bhargavi says:

    Thanks so much for this post. It has been a great help. I tried customizing four different event calendar plugins and failed. This route is working.

  13. Michael says:

    I’m only getting a Parse error: syntax error, unexpected T_ENDWHILE

    on the events page. I’ve tried on different themes too…

  14. bumpershine says:

    Sounds like you are missing a “}”, or I am.

  15. Guy says:

    I am also getting an error:

    Parse error: syntax error, unexpected T_ENDWHILE in …\wp-content\themes\twentyten\calendar.php on line 188

    Is there a fix for it? I’d love to get this working as I think it’s a great idea.

  16. bumpershine says:

    @guy I haven’t checked the code lately, but it sounds like you are missing a “}”, or I am.

  17. Guy says:

    Any idea where? I’m not a programmer really so any clues would be appreciated 🙂

    1. bumpershine says:

      Check the line number of the error message.

  18. Guy says:

    It was just referring to a blank line. Anyway I have found another way of doing this thanks to this plugin:

    http://cstart.blogspot.com/2010/05/ajax-booking-availability-calendar.html

    thanks anyway.

Comments are closed.