PHP WordPress

I currently have a filter set it up for my conferences list, everything is working perfectly. I want to add a toggle/switch that when is on, shows all the conferences (even the past ones). Right now is only showing the ones starting from today (‘value’ => date (‘Ymd’),). I was thinking to create a function that checks if the switch is on or off and it depends on the answer it gives the ‘value’ a different value. But I’ve tried everything and it’s not working, maybe I am doing something wrong.

Ps.: I am using date(“Y-m-d”, strtotime(‘2017-02-02 17:02:03’)); to show the past conferences. If I add that to the ‘value’ manually it shows the past ones perfectly.

If you want to show all conferences, why are you filtering on any date at all? Just don’t add the query unless you need it; only add it when you want to filter out past conferences.

Sponsor our Newsletter | Privacy Policy | Terms of Service