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/
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..
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");
nwonderland
Member
Posted 2 years ago #
Rhand, where did you add this?
In template.php after $events = . So you get:
$events = get_posts("post_type=events&numberposts=-1&order=ASC&orderby=post_date");
kole.krstev
Member
Posted 2 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...
azjaleah
Member
Posted 2 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.
kole.krstev
Member
Posted 2 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");
azjaleah
Member
Posted 2 years ago #
Thank you! I did replace that line successfully with your code. Much appreciated!