All-in-One Event Calendar
Order event by start date (8 posts)

  1. carletto0282
    Posted 3 years ago #

    Hi guys,

    great work with this plugin... I'd like to ask just one more thing: I get the code shown below and I'd like to order query results by start date.
    Any suggestion?

    [Code moderated as per the Forum Rules. Please use the pastebin]

    So this is my code... as you can see in the arg array I set orderby -> date but obviously it's the posting date not the start date of the event.

    I hope you can help me.



  2. carletto0282
    Posted 3 years ago #

    I'm so sorry for the code issue.
    Hope this is ok.

    Events query

  3. Yani Iliev
    Plugin Contributor

    Posted 3 years ago #

    Events are posts but event start/end date != post date.
    When you make a query, you have to do an event query, not post query.
    In other words, you have to use plugin's API to retrieve events ordered by start or end dates.
    The function of interest is get_events_between().
    It is located in Ai1ec_Calendar_Helper class.
    The class is located in: app/helper/class-ai1ec-calendar-helper.php
    I modified your code a bit. I haven't tested it so there might be typos or other errors but the logic is the same:

  4. carletto0282
    Posted 3 years ago #

    Hi Yani,

    thank you very much for your help.
    Actually I'm on another task.

    I will give a check on your tips as soon as possible.

    Hope they could be useful as they seem to be!
    Thanks again


  5. Ricky Lee
    Posted 3 years ago #

    This pastebin code does not echo out anything. Desperately trying to style my own upcoming agenda view.

    Thanks in advance.

  6. sarahla
    Posted 3 years ago #

    This is exactly what I need, but the code isn't working. I've looked it over but I'm not familiar enough with ai1ec to find the problem.

    Anybody have any luck?


  7. postoy
    Posted 3 years ago #

    As of version 1.8.3:


    The functions of importance are:


    If you try to run the code from pastebin, there is no output. Review agenda-widget.php for variables.

  8. Richard
    Posted 3 years ago #

    Thanks for your help, postoy.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • All-in-One Event Calendar
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic