- This topic has 4 replies, 2 voices, and was last updated 3 years, 8 months ago by .
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘How do I …’ is closed to new topics and replies.
Events Made Easy › Forums › How do I … › Filter by past years
For documentary reasons I would like to show events of the of the past years.
So I created a page including [eme_filterform template_id=11] and [eme_events] shortcodes. The template with the id=11 contains the placeholder #_FILTER_YEARS for the dropdown selection of the upcoming years.
Is there a possibility that the dropdown list also shows the past years?
Currently not possible via the interface, but you can use the filter eme_year_scope_filter to change the scope array being used.
Thanks for the hint, Franky!
So I succeeded to modify the scope array with the following filter:
add_filter('eme_year_scope_filter','my_eme_year_scope_filter');
function my_eme_year_scope_filter() {
$my_years = array(2019,2020,2021,2022);
return $my_years;
}
However [eme_events template_id=4 template_id_header=5 template_id_footer=6 limit=0], which is placed on the same page, shows always future events, independent of the year selected in the filterform.
That is because your scope is incorrectly formatted (take a look at the generated html code without your modifications). I added some more info on the page https://www.e-dynamics.be/wordpress/hooks-and-filters/ , with an example for adding years.
Now I got it! Thanks a lot!