[Plugin: Events Manager] show all days of the current week
-
Hi I am stuck with my query, please help.
I am using the free version. Using version 5.1.4.3
What I want is to see all the days of the current week. But now my querie doesnt show the days before today only the days left in this week. e.g. on friday the days monday, tuesday and wednesday, thursday aren’t shown
In the page I use the following shortcode:
[events_list category=”30,31,33″ scope=”this-week” ]
i made the following query:
add_filter( ’em_events_build_sql_conditions’, ‘my_em_scope_conditions’,1,2);
function my_em_scope_conditions($conditions, $args){
if( !empty($args[‘scope’]) && $args[‘scope’] == ‘this-week’ ){
$week_number = date(‘w’);
$start_date = date(“Y-m-d”,time() – ($week_number – 1)*ONE_DAY);
$end_date = date(‘Y-m-d’, strtotime(‘Next Sunday’, time()));
$conditions[‘scope’] = ” (event_start_date BETWEEN CAST(‘$start_date’ AS DATE) AND CAST(‘$end_date’ AS DATE)) OR (event_end_date BETWEEN CAST(‘$end_date’ AS DATE) AND CAST(‘$start_date’ AS DATE))”;
}
return $conditions;
}please help
check https://www.vanrheenensport.nl/budo-sport-almere/pencak-silat-almere/the orange box holds the result of the query
thanks,
fabian
- The topic ‘[Plugin: Events Manager] show all days of the current week’ is closed to new replies.