Terms loop with exclusion

Hello guys,

After hours, I decide to ask you a solution for, to my mind, a stupid issue.

To sum up:

  • I’ve created a CPT ‘Bicycle sheet’ (ACF PRO)
  • I’ve created a taxonomy (ACF PRO) ‘Bicycle categories’.
  • I’ve created a layout archive to display the various listings by ‘Bicycle category’.

All that, it works, it’s great.

In the page I’ve created a loop with an ‘all terms’ provider on ‘Bicycle category’: it works.

Except that I only want the terms ‘sale’ (“vente” in screenshots) and its children (not “Location”)
I’ve tried writing the ‘all terms’ query as a query string and then trying to exclude it… but now I’m going round in circles.
How can I loop over terms with exclusion?

:pray:

Hey @cpennetier,

Thanks for writing in! Instead of using the Looper Provider All Terms, you will need to use the Looper Provider Current Post Terms so that only terms associated with the items will display.

If this is not helping, we would love to check your layout if we can log in. You can create a secure note in your next reply with the following info:
– Link to your site
– WP login URL
– WP username
– WP password
– WP Administrator Role
– Confirmation that we can access and make changes to your site

To know how to create a secure note, please check this out: How The Forum Works

image

Best Regards.

Hi @ruenel,

Thanks for your answer.
I had tested but the problem with the ‘current post terms’ set to ‘bike category’ is :

  • I’m on ‘bike sales’ (the parent category - Level0), I have everything
  • When I click on 1 child category (L1 or L2), I lose the other L1 category and the other L3 categories.

The aim is to always have categories L0 - L1 - L2.

I succeeded with a blog but the same system didn’t work there.
I’ll send you a secure note.

Hello @cpennetier,

Since you want to display the child categories of the parent category/ies, you may need to use the Looper Provider Custom. Please check out these old thread as your guide of how you can return the child categories:

Best Regards.