Conflict with custom sorting (always working as ASC, DESC not working)
-
We created custom sorting
We used
<?php $queriedVar = get_query_var('paged'); $countPosts = 12; $paged = ($queriedVar) ? $queriedVar : 1; $args = [ "post_type" => "post", "posts_per_page" => $countPosts, "post_status" => "publish", 'paged' => $paged, ]; if(isset($_GET["price"]) && ($_GET["price"] === "from-max" || $_GET["price"] === "from-min")) { $args["meta_key"] = "product_price"; $args["orderby"] = "meta_value_num"; $args["suppress_filters"] = true; if($_GET["price"] === "from-min") { $args["order"] = "ASC"; } elseif ($_GET["price"] === "from-max") { $args["order"] = "DESC"; } } print_r($args); $catalogProducts = new WP_Query($args); ?>
When plugin deactivated – then our custom sorting working perfect, but when plugin active – then always ASC order in both solution (same result with ASC and DESC query – always ASC).
Please provide some hook with some code or some other solution to solve our problem.
Thank You, Vitaliy.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Conflict with custom sorting (always working as ASC, DESC not working)’ is closed to new replies.