Forums

WordPress Event Calendar
Can you group the events by year? (4 posts)

  1. Emerging Fervour
    Member
    Posted 2 years ago #

    Hi
    I'm using and loving the WordPress Event Calendar but would like to have a year heading for the list view so it's clear which events are this year, next and so on.
    Is that possible?
    Thanks
    Nathalie

    http://wordpress.org/extend/plugins/wordpress-event-calendar/

  2. bloomcreative
    Member
    Posted 2 years ago #

    Nathalie,

    Wondering if you ever solved your problem. I am trying to solve a similar issue with just showing events for the current month. According to the documentation, a query structured similarly to query_posts should work:

    <?php
      $month = date('F');
      $queryObject = new WEC_Query('calendarID=2'.'startDate=' . $month);

    This has no effect. Wish someone was listening (Truth Media)

    J

  3. bloomcreative
    Member
    Posted 2 years ago #

    Jeremy at Truth Media helped me come up with one possible solution:

    // get just this months events
    $month = date('F');
    $year = date('Y');
    $queryObject = new WEC_Query('calendarID=2');
    while($queryObject->haveEvents()): $queryObject->the_event() ;
    if($queryObject->getStartDate('F') == $month && $queryObject->getStartDate('Y') == $year){
    // display code
    }

    Hope this helps someone.
    J

  4. Emerging Fervour
    Member
    Posted 2 years ago #

    Hi

    Thank you for helping to figure this out. I decided at the end not to group by year after all as it didn't affect the user journey by not seeing the year (",)

    Hope it helps other people too and I'm sure I'll need it one day - fab plugin though!

    Nathalie

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic