hi,
I m wordrpess developer. I m having problem with hiding past events from calendar and events list. Show past events option is unchecked in settings general tab but it seems its not working and past events are still showing in calendar please help. I used eo_get_events() function and its working good. Using this function i m passing showpastevents to false and it works but can not figure it out how to disable past events on calendar page.
Thanks
Sajid
Hi Sajid,
I want your problem! How did you get past events to show up on the calendar widget, but not on the events-archive? I have the newest update & all past events completely disappear when ‘show past events’ is unchecked.
Could you tell me which file to go into and edit it so that ‘show past events’ to false?
Many Thanks,
Jamie
Jamie
Hi Sajid – currently you cannot disable past events on the ‘fullCalendar’ but you can on the widget calendar. The general settings option really only applies to the event pages (as opposed to the widgets/shortcodes which generally have their own options – fullCalendar excepting!)
@Jamie – you should be able to select ‘show past events’ for the calendar widget, and deselect ‘show past events’ in the general settings.
Stephen Harris
Hi Stephen,
It must have been the cache messing it up yesterday, but I got it to look the way I want it to today.
Thanks!
Jamie
Hi Jamie,
I code my self in separate theme file by using the eo_get_events() function to full fill the designing needs.
`
UCOMING EVENTS
<table cellpadding="0" cellspacing="0" border="0" width="80%" class="table_events">
<?php
$events = eo_get_events(array(
'numberposts'=>5,
'events_start_after'=>'today',
'showpastevents'=>true,//Will be deprecated, but set it to true to play it safe.
));
if($events):
$i = 0;
foreach ($events as $event):
//Check if all day, set format accordingly
if(is_odd($i)){
$class = ”;
}else{
$class = ‘tr_color’;
}
$format = ( eo_is_all_day($event->ID) ? get_option(‘date_format’) : ‘m/d/y’ );
printf(‘ %s %s ‘,
$class,
eo_get_the_start($format, $event->ID,null,$event->occurrence_id),
get_permalink($event->ID),
get_the_title($event->ID)
);
$i++;
endforeach;
endif;
function is_odd( $int )
{
return( $int & 1 );
}
?>
`
@harris is there any parameter for full calendar shortcode becuase client insist on hiding the past events from calendar or is there any thing you are working for next update.
Thanks
Sajid
Hey Harris,
I did that by changing the file event-organizer-ajax.php showpastevents from true to false. But this is hardcoded i wish if there is any way to that from shortcode parameter or anything else. Here is the link
http://vinecrushconsulting.com/?page_id=373.
Thanks
Sajid
Ah,
Yes, currently its hardcoded that the fullCalendar shows past events. Maybe this could be an option for 1.9 (aka 2)? It would require sending the option with the ajax request (in the same way the widget calendar handles this). Pull requests welcome, but if there are no takers, I’ll get round to it myself when I have the time.
Stephen Harris