ACF nested looper to display FAQ per category

Hi there,

I am trying to loop through a FAQ Category taxonomy, having one Section per category with the category_name in the left column and the questions and answers in the right column (ACF populated accordion).

While there are sections for each category, my page keeps showing ALL questions of ALL categories in each section. The left column shows the category title correctly.

Setup:
Section — Looper Provider and Looper Consumer: All Terms - Taxonomy “Hub Categories”
Column Right — Looper Provider and Looper Consumer: post_type=faq

What am I doing wrong?

Jens

Hello Jens,

Thanks for writing to us.

To help you with your concerns we need to check your settings, I would request please share the admin login details meanwhile I would suggest you troubleshoot a few of the common issues before we investigate your settings. Please share your details in a secure note. Please provide the following details

  • WordPress Login URL
  • Admin-level username and password
  • Exact URL

You can find the Secure Note button at the bottom of your posts

Thanks

Hello jens,

Your query string is incorrect. The correct query argument should be:

$args = array(
  'post_type' => 'faq',
  'tax_query' => array(
    array(
      'taxonomy' => 'hub-category',
      'field' => 'slug',
      'terms' => '{{dc:term:slug}}',
    ),
  ),
);

This will give you a query string of post_type=faq&tax_query%5B0%5D%5Btaxonomy%5D=hub-category&tax_query%5B0%5D%5Bfield%5D=slug&tax_query%5B0%5D%5Bterms%5D={{dc:term:slug}}

The element structure should be this way:

SECTION - Looper Provider All Terms
    ROW - Looper Consumer
        Column 1 - 
               Headline 
         Column 2 - 
               Accordion - Looper Provider Query String
                    Accordion Item - Looper Consumer

Kindly let us know how it goes.

Hi @ruenel,

That worked out great! Thank you so much!

Regards,
Jens

You are most welcome, Jens.

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