Forums Forums Search & Filter Pro Count for All Items

Viewing 7 posts - 1 through 7 (of 7 total)
  • Anonymous
    #254779

    Hi, is it possible to display a count against the ‘All Items’ radio option for a filter? The filter is working fine and shows the count against the criteria I’ve set but would be good to show the ‘all’ count too:
    https://holly.undermywing.org.uk/hen-rehomings/

    Screenshot of form attached.Screenshot of form

    Anonymous
    #254780
    Trevor
    #254822
    Anonymous
    #254861

    Thanks for this.

    Anonymous
    #254872

    Hi Trevor, sorry, this doesn’t seem to be doing what I thought – the total should be 43 but it’s pulling in 4:
    https://holly.undermywing.org.uk/hen-rehomings/

    If I set the filter to ‘auto’ it does pull in the right total, but I need to change the labels.

    Trevor
    #254877

    All it will do is count the counts from other options, which it is doing. If there are posts without options, that it cannot do. For that you would need to find the total posts count and add that to the label.

    The input object does not have that count, but the results array does, generally fetched, I think, like this:

    $total_count = $query->found_posts;

    Anonymous
    #254888

    Thanks Trevor, I’ll take a look.

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