Support » Plugin: Events Manager » Set event ordering for #_CATEGORYPASTEVENTS placeholder

  • Resolved roger995

    (@roger995)


    hi,

    In ‘Formatting >>Event Categories >> Single Category Page’, the ‘Single category page format’ field is set to:

    #_CATEGORYNOTES<h3>Upcoming Events</h3>#_CATEGORYNEXTEVENTS
    <h3>Past Events</h3>#_CATEGORYPASTEVENTS

    ‘Pages >> Event categories >>General settings ‘Default archive ordering’ is set to ‘Order by ‘start date,start time’ ascending

    I want to order by ‘start date,start time’ *descending* for the #_CATEGORYPASTEVENTS placeholder (globally). Future events and past events on category pages would each have their own ordering.

    I see the function at http://wp-events-plugin.com/tutorials/modifying-placeholder-default-information/ but could use help regarding what use in in the ‘$replace = $replace . ” plus some modifications”;’ line.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    at the moment you need additional coding to make this work to override this placeholder – http://wp-events-plugin.com/tutorials/create-a-custom-placeholder-for-event-formatting/ (changing event with category)

    for reference you can see the original placeholder under classes/em-category.php

    Thread Starter roger995

    (@roger995)

    Wasn’t easy, but this is working (did a similar one for event tags as well).

    add_filter('em_category_output_placeholder','cat_em_placeholder_mod',1,3);
    function cat_em_placeholder_mod($replace, $EM_Category, $result){
    	if ( $result == '#_CATEGORYPASTEVENTS' ) {
    	$em_termID = $EM_Category->term_id;
    	$args = array('category'=>$em_termID,'order'=>'DESC','scope'=>'past','pagination'=>1, 'limit'=>20);
    	$args['format'] = get_option('dbem_category_event_list_item_format');
    	$args['format_header'] = get_option('dbem_category_event_list_item_header_format');
    	$args['format_footer'] = get_option('dbem_category_event_list_item_footer_format');
    		$replace = EM_Events::output($args);
    	}
    	return $replace;
    }
    
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Set event ordering for #_CATEGORYPASTEVENTS placeholder’ is closed to new replies.