Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Guido

    (@guido07111975)

    No, my plugin doesn’t have this feature.

    But with some manual work you can display events per week. Create event categories for each week (for example: Week 1, Week 2, Week 3, etc) and add the relevant category (week) to each event. Than change the categories attribute each week, example:

    
    event_cat="week-2"
    

    (add the slug of the category, not the name)

    Guido

    Thread Starter crohana50

    (@crohana50)

    Hi,
    Thank you for that answer. I racked my brains a bit, and I finally found a solution by slightly modifying the request in the vsel-widget-shortcodes.php file.

    		// query
    		$today = vsel_local_timestamp();
    		$currentday = date(l);
    		if ($currentday == "Monday") {
    			$mondaytimestamp = strtotime('This Monday');
    		}else{
    			$mondaytimestamp = strtotime('Last Monday');
    			 }
    	
    			$sundaytimestamp =  strtotime('This Sunday');
    			$sundaytimestamp = $sundaytimestamp + 86399;
    	
    		$vsel_meta_query = array(
    			'relation' => 'AND',
    			array(
    				'key' => 'event-date',
    				'value' => array ($mondaytimestamp, $sundaytimestamp),
    				'compare' => 'BETWEEN',
    				'type' => 'NUMERIC'
    			)
    		);

    So far, it works. We’ll see tomorrow (Tuesday), if it still works ??

    Plugin Author Guido

    (@guido07111975)

    Hi,

    You can always change plugin files, but I won’t recommend this because of future plugin updates.

    Great fix, only thing that’s not taken into account is the timezone. But that’s optional.

    Guido

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display the current week as a widget’ is closed to new replies.