Staff Directory Page (Nested Looper)

Hi there, I want to create a staff directory page. I have a CPT named Staff, with a Category for the department.
I want to create a page that loop through the Staff Categories, an inside the category pull all the staff members that belong to it. I don’t want to create different loopers per category, I want this to be scalable, if I add a new category, it should be pulled on the front-end without me touching anything else.
Something like this:


I can’t figure it out how to do the loop.

Hello @mcostales84,

Thanks for writing in!

You can nest two Looper Providers in your page having a structure like this:

Looper Provider All Terms (Taxonomy: Categories)
    Looper Consumer

        Looper Provider Query String ( `post_type={your-cpt}&category_name={{dc:term:slug}}` )
            Looper Consumer

Hope this helps. Kindly let us know how it goes.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.