WordPress.org

Forums

Kino Events Calendar
[resolved] Events order :: Most Recent First (9 posts)

  1. Rhand
    Member
    Posted 4 years ago #

    Translated Kino Events Calendar and added events. Issue now is that I need the most recent upcoming events to come up, not the most recent added the way the are displayed on a page where they are loaded with the shortcode [events]. How can that be achieved?

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

  2. Rhand
    Member
    Posted 4 years ago #

    I tried

    get_posts("post_type=events&numberposts=-1&orderby=post_date('ASC')");

    But clearly my syntaxis is off as it does not change a thing..

  3. Rhand
    Member
    Posted 4 years ago #

    This does seem to work. A hack, but one that does the trick:

    get_posts("post_type=events&numberposts=-1&order=ASC&orderby=post_date");
  4. nwonderland
    Member
    Posted 4 years ago #

    Rhand, where did you add this?

  5. Rhand
    Member
    Posted 4 years ago #

    In template.php after $events = . So you get:

    $events = get_posts("post_type=events&numberposts=-1&order=ASC&orderby=post_date");
  6. kole.krstev
    Member
    Posted 4 years ago #

    Hi

    You can order Events by "event start date" (most recent upcoming events on top).
    Use this line of code in template.php:

    $events = get_posts("post_type=events&numberposts=-1&meta_key=_event_start_date&orderby=meta_value&order=ASC");

    Works for me...

  7. azjaleah
    Member
    Posted 4 years ago #

    I have no experience with php and frankly it scares me to change the code! As in, where exactly do you insert these snippets?

    So this is my quick fix (go ahead and groan now..):
    I just change the date and/or time the event is published in the Events list.

    I really love this little sidebar calendar and wish that the developer could add all these fixes to get it to function correctly. The real shame is that it is so incompatible with other plugins using jquery.

  8. kole.krstev
    Member
    Posted 4 years ago #

    You need to update template.php file (in your plugin directory).

    Comment line number 4:
    $events = get_posts("post_type=events&numberposts=-1");
    and insert this code:
    $events = get_posts("post_type=events&numberposts=-1&meta_key=_event_start_date&orderby=meta_value&order=ASC");

  9. azjaleah
    Member
    Posted 4 years ago #

    Thank you! I did replace that line successfully with your code. Much appreciated!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Kino Events Calendar
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic