Events Made Easy Forums How do I … Filter by past years

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #62358
    Anonymous
    Inactive

    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?

    #62359
    Franky
    Keymaster

    Currently not possible via the interface, but you can use the filter eme_year_scope_filter to change the scope array being used.

    #62360
    Anonymous
    Inactive

    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.

    #62362
    Franky
    Keymaster

    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.

    #62363
    Anonymous
    Inactive

    Now I got it! Thanks a lot!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘How do I …’ is closed to new topics and replies.
Scroll to Top