Displaying a list of months

Home Forums Calendar Products Events Calendar PRO Displaying a list of months

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #26944
    Jonathan Martin
    Participant

    Hi Guys,
    What we’d like to do is produce a widget that works in a similar to the standard WordPress archives widget but for future events.

    What we need is a list of months (eg. the next 12 months) and a link for each month to allow users to filter the events for a given month.

    We can work out how to do it using a custom function that loops over all events in the next 12 months and uses the event start date to work out which month it should appear in, but this doesn’t seem to be very efficient. Is there a better way of doing it?

    Thanks.

    #26997
    Barry
    Member

    One approach could be to handle this at query level, and pull out a list of only those months in a given year (or date range) that contain events.

    http://pastebin.com/FHCFiB9K

    #27020
    Jonathan Martin
    Participant

    OK cool, that’s vaguely like how I thought we’vd have to do it. I’ll investigate and thanks for the advice.

    #27028
    Barry
    Member

    No problem – if you’re all sorted I’ll mark this as answered and closed, but if you need any more pointers feel free to shout back.

    #978037
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Displaying a list of months’ is closed to new replies.