Search & Filter
-
I am using this code in search.php
<?php $args = array( 'post_type' => 'blog', 's' => $keyword, ); if($sort == 'title-desc' || $sort == 'title-asc') { $orderby = explode( '-', $_GET['sort'] ); $args['orderby'] = $orderby[0]; $args['order'] = $orderby[1]; } $args['tax_query'] = array( 'relation'=>'AND' ); if( isset( $_GET['category'] ) ) $args['tax_query'][] = array ( 'taxonomy' => 'category', 'field' => 'id', 'terms' => $_GET['category'] ); $the_query = new WP_Query( $args ); relevanssi_do_query($the_query);
I am facing the problem that the order of posts does not change when using tax_query or orderby.
Looks like the posts are sorted by resvanssi.
How can I fix this problem.
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Search & Filter’ is closed to new replies.