// Uncomment the line below to see what variables are being passed from the URL querystring
<div id="content" class="site-content" role="main">
<?php echo get_search_query() ?>
<form class="search" method="get" action="#" role="search" autocomplete="off" >
<input type="text" placeholder="keyword" name="keyword" value="<?php echo $keyword; ?>">
<?php
wp_dropdown_categories(array(
)
);
?>
<?php
$terms = get_terms(array(
'hide_empty' => false,
'hierarchical' => 1,
));
echo '<div class="checkboxlist">';
foreach( $terms as $term ){
$stat = '';
}
echo '</div>';
?>
<input type="submit" value="Search" class="form-submit">
</form>
<?php
$tax = array();
// Prepare taxonomy array for select form field
$tax[] = array(
'field' => 'name',
'terms' => array( $category_select_value ),
'operator' => 'IN',
);
} else {
//$tax[] = '';
}
// Prepare taxonomy array for checkbox form field
$tax[] = array(
'field' => 'name',
'operator' => 'IN',
);
} else {
//$tax[] = '';
}
// Protect against arbitrary paged values
$paged = ( get_query_var( 'paged' ) ) ? absint( get_query_var( 'paged' ) ) : 1;
$use_wp_args = array(
'tax_query' => array(
'relation' => 'AND',
$tax
),
'date_query' => array(
array(
)
),
);
// Uncomment the line below to see what arguments are being passed via $use_wp_args
// var_dump($use_wp_args);
// The Query
$use_wp_query = new WP_Query( $use_wp_args );
echo '<div class="query-count">' . $use_wp_query->found_posts . ' Results Found</div>';
// The Loop
if ( $use_wp_query->have_posts() ) {
while ( $use_wp_query->have_posts() ) {
$use_wp_query->the_post();
// Display the results
}
// Pagination
?>
<div class="pagination">
<?php
echo paginate_links( array(
'format' => 'page/%#%',
'current' => $paged,
'total' => $use_wp_query->max_num_pages,
'mid_size' => 2,
'prev_text' => __('« Prev Page'),
'next_text' => __('Next Page »')
) );
?>
</div>
<?php
} else {
// no posts found
}
// Restore original Post Data
wp_reset_postdata();
?>
</div>
</div><!-- #content .site-content -->