Support » Plugins and Hacks » [Resolved] Taxonomy filter breaks pagination

[Resolved] Taxonomy filter breaks pagination

  • I’m trying to filter the event listing by using a custom taxonomy as described in a couple of other topics, here’s my code:

    function filter_events_location($events, $args){
        global $current_location;
    	foreach($events as $event_key => $EM_Event){
    		if(!is_object_in_term($EM_Event->post_id, 'site-location', $current_location))
    	return $events;

    However, this causes the pagination to break in event listings: the plugin creates as many pages as there would have been if the filter was not in place, and on top of that, some pages are blank, since the filter seems to be applying too late ( the plugin counted the unfiltered events for those pages and since the events were removed too late, they are not displayed, but they were still included in the loop ).

    I hope what I’ve said is clear enough, if not, I guess I could replicate the problem on a development server in order to show you what I mean.


Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Taxonomy filter breaks pagination’ is closed to new replies.