Hi Stephen,
in my archive-event page i’d like to hide event occurences just if are “daily” occurrences, i tryied looking at “eo_delete_event_occurrences” documentation, but i’m not so good with code! Is it possible to do it? Have you some exemple of code to show me?
Thanks
Luca
LucaWeb
eo_delete_event_occurrences()
is for deleting dates from the database rather than not disabling them. Unfortunately it’s currently not possible to query events by their schedule.
However you can ‘group events’ – which means you only display the next occurrence of an event – rather than all of them – if that’s of any use!
Stephen Harris
Hi Stephen,
yes that could be of any use, is there a function that i can insert in my archive-event.php?
I had a look and found something on the web, but i didn’t undestant to much!
txs
LucaWeb
In the while i solved my issue in the following way, so i share it maybe can be helpful:
for daily events i just set a different “end” event (i consider it as a single event that lasts several days), in this way the plugin don’t consider it as an event with reoccurences and i don’t need to hide occurences,
for to differentiate the date format from an one day event i used the following code:
$start_date = eo_get_the_start(‘l j F Y’);
$end_date = eo_get_the_end(‘l j F Y’);
if($start_date == $end_date){
//Event starts and ends on the same day
echo ‘This event is from ‘.eo_get_the_start(‘jS M Y g:i a’).’ until ‘.eo_get_the_end(‘g:i a’);
}else{
//Event spans multiple days
echo ‘This event is from ‘.eo_get_the_start(‘jS M Y g:i a’).’ until ‘.eo_get_the_end(‘jS M Y g:i a’);
}
LucaWeb
A little help, i’m now trying to show also the message using the code above, but something is wrong, i changed the code in this way
$today = ‘today’;
$start_date = eo_get_the_start(‘l j F Y’);
$end_date = eo_get_the_end(‘l j F Y’);
if($end_date < $today){
echo ‘Event finish ‘.eo_get_the_start(‘l j F Y’).’ alle ore ‘.eo_get_the_start(‘H:i’);
}elseif($start_date == $end_date){
//Event starts and ends on the same day
echo ‘Event start ‘.eo_get_the_start(‘l j F Y’).’ alle ore ‘.eo_get_the_start(‘H:i’);
}else{
//Event spans multiple days
echo ‘Event from ‘.eo_get_the_start(‘l j F Y’).’ a ‘.eo_get_the_end(‘l j F Y’);
}
LucaWeb