Hello there,
I made my own search form that's working well, but a can't the paginate_links working. Every page contains the same results as page 1.
How can help me in the right direction?
$mypostids = $wpdb->get_col("select ID from $wpdb->posts where post_title LIKE '".$_REQUEST["start_letter"]."%' AND post_type='product' ");
// print_r($mypostids);
$argssearch = array('post__in'=> $mypostids,
'post_type'=>'product',
'orderby'=>'title',
'order'=>'asc',
'posts_per_page'=>10,
'product_tag'=>urldecode( $_REQUEST["product_tag"]),
'product_cat'=>urldecode( $_REQUEST["product_cat"]),
'paged=' => $paged);
$querysearch = new WP_Query($argssearch);
echo "<br/>-".$querysearch->post_count."-".$paged."<br/>" ;
$big = 999999999; // need an unlikely integer
echo paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
'total' => $querysearch->max_num_pages,
'add_args' => array('start_letter'=>$_REQUEST["start_letter"],
'product_tag'=>urlencode ($_REQUEST["product_tag"]),
'product_cat'=>urlencode ($_REQUEST["product_cat"]),
'ZOEK' => 'Zoek'
) ));