Question
I tried to contact Jetpack but they wouldn't help Hi, I have a custom field "view_count" for my WooCommerce products. When trying to sort an archive page by it , this code works: add_filter('woocommerce_get_catalog_ordering_args', 'custom_woocommerce_get_catalog_ordering_args'); function custom_woocommerce_get_catalog_ordering_args($args) {     $orderby_value = isset($_GET['orderby']) ? wc_clean($_GET['orderby']) : apply_filters('woocommerce_default_catalog_orderby', ...
0
, , 3 days 0 Answers 15 views

Question
$queried_object = get_queried_object(); $offset = $_POST['offset']; $number_of_posts = get_option( "posts_per_page"); $args = array("posts_per_page"=>$number_of_posts,"offset"=>$offset, 'orderby' => 'DESC','category__in' => stripcslashes($queried_object->cat_ID),); $posts = get_posts($args); query_posts($args); if (have_posts()) : while (have_posts()) : the_post(); get_template_part( ...
0
2 months 0 Answers 8 views