if (stristr($product_sort, 'price')) { if (empty($product_price_range)) { add_filter('posts_join', 'compare_join_price_range'); add_filter('posts_groupby', 'compare_groupby_price_range', 10, 2); } add_filter('posts_fields', 'compare_filter_posts_fields', 10, 1); add_filter('posts_orderby', 'compare_orderby_price'); } } $products = new WP_Query($args); $product_ids = wp_list_pluck($products->posts, 'ID'); $product_metas = compare_product_item_meta($product_ids); $page_links_total = $products->max_num_pages; $pagination_args = array('prev_next' => true, 'end_size' => 2, 'mid_size' => 2, 'total' => $page_links_total, 'current' => $cur_page, 'prev_next' => true, 'prev_text' => __('Prev', 'compare'), 'next_text' => __('Next', 'compare'), 'type' => 'array'); $page_links = paginate_links($pagination_args); $pagination = compare_format_pagination($page_links); $counter = 0; ?> <form action="<?php echo esc_url(compare_get_permalink_by_tpl('page-tpl_search')); ?> " class="search-filter"> <section> <div class="container"> <div class="row"> <div class="col-md-3"> <div class="search-overlay sidebar"> <i class="fa fa-spin fa-spinner"></i> <p><?php _e('Loading results...', 'compare'); ?>
<?php wp_list_comments(array('type' => 'comment', 'callback' => 'compare_comments', 'end-callback' => 'compare_end_comments', 'style' => 'div')); ?> <!-- pagination --> <?php $comment_links = paginate_comments_links(array('echo' => false, 'type' => 'array', 'prev_text' => __('Prev', 'compare'), 'next_text' => __('Next', 'compare'))); if (!empty($comment_links)) { ?> <div class="custom-pagination"> <ul class="pagination"> <?php echo compare_format_pagination($comment_links); ?> </ul> </div> <?php } ?> <!-- .pagination --> </div> <?php if ($products_single !== 'style1' && is_singular('product') || !is_singular('product')) { ?> </div> <?php }