Display a post from custom post type only if all the selected taxonomies and custom field value matches the record
You have set “roll_number” custom field in tax_query. It should be in “meta_query”. Please try the updated code: tion exam_result_filter_function(){ $args = array( ‘post_type’ => ‘exam_result’, ); if( isset( $_POST[‘school_class’] ) || !empty( $_POST[‘academic_year’]) || !empty( $_POST[‘roll_number’]) ){ $args[‘tax_query’] = array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘school_class’, ‘field’ => ‘id’, ‘terms’ => $_POST[‘school_class’], ), … Read more