WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. carletto0282
    Member
    Posted 2 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.
    Thanks

    Carloalberto

    http://wordpress.org/extend/plugins/all-in-one-event-calendar/

  2. carletto0282
    Member
    Posted 2 years ago #

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

    Events query

  3. Yani Iliev
    Member
    Plugin Contributor

    Posted 2 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:
    http://pastebin.com/SNp4TJij

  4. carletto0282
    Member
    Posted 2 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

    Regards
    Carletto

  5. Ricky Lee
    Member
    Posted 2 years ago #

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

    Thanks in advance.

  6. sarahla
    Member
    Posted 2 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?

    Thanks.

  7. postoy
    Member
    Posted 2 years ago #

    As of version 1.8.3:

    http://pastebin.com/AKShCebx

    The functions of importance are:

    get_events_relative_to()
    get_agenda_date_array()

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

  8. Richard
    Member
    Posted 2 years ago #

    Thanks for your help, postoy.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic