Remove sorting by ID
I have search filters which filter information from 1 of 2 tables based on filter choices. Those results are then put into an array. After that they are passed into
$args. Here is what
$args=array( 'post_status' => 'publish', 'post_type' => 'products', 'tax_query' => array( array( 'taxonomy' => 'product_categories', 'terms' => explode(',', $groups_separated), 'field' => 'slug', ) ), 'posts_per_page' => 30 );
$argsin my loop:
$keep = query_posts($args);
The order that
$groups_separatedis in when it goes into
$argsis the order that I would like the information to be displayed in. However when the loop is ran, the results appear to be displaying by
WP_Post Object ( [ID] => 158.
I have thought of two ways to possibly get my results to display in order, but not sure how to implement them. The first way would be to just have my loop display the results by order that they are passed into
$args. The second, I think far more difficult, would be to join tables (my table from the search filter with
wp_query) then add a sort. I am not sure how to go about either and there may be a better way, just looking for ideas or some guidance with either way I mentioned.
- The topic ‘Remove sorting by ID’ is closed to new replies.