Changing WP_Query params with url Query Var
This code manually sets the order with the ‘order’ => ‘ASC’ declaration in the WP_Query arguments. $loop = new WP_Query( array( ‘post_type’ => ‘product’, ‘meta_key’ => ‘product_price’, ‘orderby’ => ‘meta_value_num’, ‘order’ => ‘ASC’, ‘posts_per_page’ => 4, ‘paged’ => $paged) ); If we want to pass a url parameter to that we could use something like: … Read more