Filtering Terms With Nested Loops?

I’m not entirely sure if this is addressed elsewhere, but I have a question regarding custom taxonomies and filtering terms.

As suggested in a previous thread, I am using a Looper Provider (All Terms) and set the taxonomy to the custom taxonomy I made earlier in ACF. All terms are listed without issue. What I’m trying to do is if a user clicks a sub-category, the list of custom taxonomy terms will auto-update with relevant terms ONLY for that sub-category.

Reading other threads, such as this one: Dynamically filter looper content with terms buttons, the answer may be to use nested loops. Or maybe a query string that checks the current category the user is in?

image

So I did some more testing and reading and have a Looper Provider (All Terms, custom taxonomy selected) and Looper Consumer set up in the Terms (Collections) row. In the List Item column, I added a Looper Provider (Current Term, custom taxonomy selected) and Looper Consumer and the first term pulled is correctly corresponding to the sub-category a user is in but any other term is just a duplicate of that term. We’re getting closer to the solution but clearly I’m missing something it seems haha…

Hello @dobacco,

Thanks for writing in!

Please be advised of the following:

Looper Provider All Terms - will display all the terms of the selected taxonomy. It would return terms in alphabetical order by default.

Looper Provider Current Terms - should and only be used when displaying the current taxonomy of the current post/product item. You cannot nest this with the Looper Provider All Terms.

Now, if you want to display only the parent terms of the taxonomy, we highly suggest that you use the Looper provider Custom. Take this old thread as a reference:

If you can share to us the URL of the page where we can find the display of the taxonomy, we would be glad to check it.

Best Regards.

Thanks for writing back with your suggestions. I will leave a secure note for you to see what I’m trying to do.

Thank you for the info. We tried logging in but the provided password is incorrect. Please check the info carefully or provide another admin account.

Sorry about that. Try the login again.

Have you tried using the Looper Provider > Custom as described in the previous thread?

PHP Warning (WC sub-categories in “Terms (cloud)”)

Please check this documentation for more info about custom looper provider: https://theme.co/docs/loopers#custom

I tried using the code from the thread you linked but it doesn’t seem to do anything. I wonder if it is because I am utilizing a custom taxonomy whereas the child theme code is just checking for the subcategory of the main product categories instead of the custom taxonomy.

It would be nice if Looper Provider (Current Post Terms) could be used since it is able to at least pull the first term of the custom taxonomy.

Hello @dobacco,

You will have to use Looper Provider All Terms and select “Collection” as your taxonomy:

Best Regards.

Ruenel,

That is exactly what I did before as mentioned in the first post of this thread. Again, the issue is if you go in to product sub-category that the listed Collections terms does not change as it’s listing ALL Collections terms regardless of which product sub-category you are in.

For example, if I were to click on the product sub-category, “Manga”, there should only be two terms under Collections:

Appreciate any guidance on how to move forward on this.

Hello @dobacco,

If you go to your Collections, they are all parent items. They do not have parent/child relation or that they are NOT heirarchical.

You must edit your custom taxonomy and enable the “Heirarchical” option. And then you can use the Looper Provider Custom mentioned on this thread:

Kindly let us know how it goes.