I have a custom search page via which I select:
One or ALL categories
One or ALL tags
One or ALL authors
A search string or no search string
On the results page, wp_query works when I have selected values. But how do I instruct to set some param as ALL? How do I set "search ALL categories" for example?
Maybe I need to break my args and add to them only when I got values? But how would I do that?
Thanks.
EDIT
I modified the wp-query and now stands as follows. All works great but I do not have paging!
$args = array( 'order' => 'DESC', 'orderby' => 'date', 'posts_per_page'=> 10 );
if ( '0' != $category ) { $args['cat'] = $category; }
if ( '0' != $tag ) { $args['tag'] = $tag; }
if ( '0' != $author ) { $args['author'] = $author; }
if ( '' != $search ) { $args['s'] = $search; }
$the_query = new WP_Query( $args );
while ($the_query-> have_posts()) : $the_query->the_post();
....
endwhile;
wp_pagenavi( array( 'query' => $the_query ) );