• Perfect day for all :-).

    Please, I have a trouble with filtering post by category. I filter it, but the sorting by post view count doesn´t work. How can I solve it?

    It´s my code:

    $r = new WP_Query( array(	'posts_per_page' => $number,
    									'cat'=>$_POST['category_id'],
                      'no_found_rows' => true,
    									'post_status' => 'publish',
    									'ignore_sticky_posts' => true,
    									'meta_key' => $meta_key,
                      'meta_value_num' => '0',
    									'meta_compare' => '>',
    									'orderby'=>'meta_value_num',
    									'order'=>'DESC',
    									'author'=>$author_id,
                      'category__not_in'=>'208',
    									'post_type'=> apply_filters( 'baw_count_views_widget_post_types', $bawpvc_options['post_types'] )
    								)
    						);

    In POST is number of category page, which call the loop of posts.Please much, I spend all week of testing different query.

    https://ww.wp.xz.cn/plugins/baw-post-views-count/

The topic ‘Category filter’ is closed to new replies.