Skip Navigation

[Closed] Taxonomy filter not showing all taxonomies

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 0 replies, has 1 voice.

Last updated by Minesh 2 weeks, 6 days ago.

Assisted by: Minesh.

Author
Posts
#2787771
Screenshot 2024-12-12 at 1.00.17 PM.png

I am trying to: Filter a view on post type "media" by a taxonomy.

Link to a page where the issue can be seen: hidden link

I expected to see: All 4 taxonomies in the dropdown filter since all taxonomies have at least one media item tagged with each taxonomy:
- Non-Vintage (non-vintage)
- Bottle Shot (bottle-shot)
- Production & Tasting Notes (production-tasting-notes)
- Production Photo (production-photo)

Instead, I got: Only 3 show up in the dropdown. Also, on the taxonomy edit page (hidden link), the counts are off. See the screenshot to compare how many items appear on the page to the counts. The one that appears as a 0 count is the one not showing.

I see team member has had a similar issue in the past: https://toolset.com/forums/topic/view-dropdown-not-showing-all-taxonomies/

I adjusted the code that was provided (see below) and tried adding the snippet on a staging site, but it didn't work.

//Update count callback for taxonomies attached media attachments
function change_media_category_arg() {
    global $wp_taxonomies;
 
    if ( taxonomy_exists('non-vintage') ) {
        $wp_taxonomies['non-vintage']->update_count_callback = '_update_generic_term_count';
    }
 
    if ( taxonomy_exists('bottle-shot') ) {
        $wp_taxonomies['bottle-shot']->update_count_callback = '_update_generic_term_count';
    }
   
    if ( taxonomy_exists('production-tasting-notes') ) {
        $wp_taxonomies['production-tasting-notes']->update_count_callback = '_update_generic_term_count';
    }
   
    if ( taxonomy_exists('production-photo') ) {
        $wp_taxonomies['production-photo']->update_count_callback = '_update_generic_term_count';
    }
 
}
add_action( 'init', 'change_media_category_arg', 9999 );
#2787785

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you please share admin access details and let me check whats going wrong with your setup.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2787860

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Unfortunately - the admin access details you shared is not working at this end.

Can you pelase send me working admin access details.

I have set the next reply to private which means only you and I have access to it.

#2788020

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please check now: hidden link

with the view's "Custom search settings":
=> hidden link

I have set the option to "Always show all values for inputs" as you can see with the following screenshot:
=> hidden link

Now, you will be able to see all the options.

#2788022

Hi Minesh,

Thank you for alerting me to that setting, but while it shows all the options under media type, it also shows all the options under the vintages and wines, which is not how it's supposed to be. For example, the vintage years only showed the posts that had years selected, but now they are showing all possible years.

#2788033

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

The thing is that the filter either sync and display all values or display the filters values based on available result.

If you want only taxonomy filter with all terms - then we will have to add custom shortcode to fetch the all terms and then display the custom search filter.

Do you want to dispaly all terms of media-type taxonomy or terms where media is assigned?

The topic ‘[Closed] Taxonomy filter not showing all taxonomies’ is closed to new replies.