group by id for correcting pagination
-
Hi,
I make a custom query to search event from category and tag..but I have problems with recurring events.
In fact, I want to be shown in the search result only the next event and not all occurrences of that event. I managed to do this by removing the duplicates in the loop, but the pagination is wrong because It also calculates recurring events. How can i group by eo_event.post_id instead eo_event.event_id in the main query?this is my query
$connected = new WP_Query( array( 'post_type' => 'event', 'cat' => $cat, 'orderby' => $orderby, 'order' => $order, 'paged' => $paged, 'posts_per_page' => $posts_per_page, ) );
and this is my pagination code
${'page_args_'.$currenttab} = array( 'base' => @add_query_arg( 'page_'.$currenttab, '%#%' ), 'current' => ${'page_'.$currenttab}, 'total' => $$currenttab->max_num_pages, 'add_fragment' =>'#tab_'.$currenttab ); echo paginate_links( ${'page_args_'.$currenttab} );
The page is divide in tab, each one search by different post_type..
thanks for an answer
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘group by id for correcting pagination’ is closed to new replies.