Forums Forums Search & Filter Pro Determine is search active on Post Type Archive

Viewing 2 posts - 1 through 2 (of 2 total)
  • Anonymous
    #261746

    I have worked part of this out – hoping it won’t cause me any problems…

    $expression = filter_input(INPUT_GET, '_sfm_ca-year') . $_GET['sf_paged'] ;
    			$terms = get_the_terms( $post->ID , 'body' );
    foreach ( $terms as $term ) {
    } 
    				if ( empty($expression)) :

    Still wondering about adding an accurate count though.

    Trevor
    #261833

    You can write some custom code to find the filter terms in use, but it does requires some digging to find the variable names first (especially if you allow more than once choice per field), and you can find the total results count. So, this code gets the count (but you need the query variable/array name, so it might not be $query):

    $number_of_results = $query->found_posts;

    To figure that the variables are, you need to output the array holding the filter, then make a note of the variable names. see this post:

    https://support.searchandfilter.com/forums/topic/acf-post-meta-fields-in-current_query-result/#post-249704

Viewing 2 posts - 1 through 2 (of 2 total)