Help with Filtering FAQs by Two Taxonomies on Archive Pages

Hi everyone,

I’m currently working on a FAQ system in WordPress using Loops and Logic, and I need some guidance to accomplish my goal. The system is built with a custom post type and two custom taxonomies, and while I have some functionality working, I’m struggling with implementing a specific query to filter the posts as needed.

My web page is located here:

Project Overview:

  • Custom Post Type: loan-faq
  • Taxonomy 1: faq-topic (topics like “Auto Loan FAQs”, “Used Car Loan FAQs”)
  • Taxonomy 2**: faq-type (question types like faq, saq, maq)

My Goal:

I need to display FAQ posts on a taxonomy archive page filtered by:

  1. The current faq-topic term (based on the taxonomy archive page I’m viewing).
  2. The faq-type taxonomy to show only posts tagged with the faq term (or saq/maq in other sections).

Current Working Setup:

I have the accordion structure working for the FAQ section using this snippet:

The Issue:

I need to modify the query so that:

  1. It filters posts by the current faq-topic taxonomy term (from the taxonomy archive page).
  2. It also filters posts by the faq-type taxonomy term (specifically faq for one section, and later saq and maq for other sections).

What I Tried:

I attempted the following query, but it’s not filtering as expected:

What I Need Help With:

  1. How can I properly filter posts based on both the current faq-topic term and the faq-type term?
  2. Is there a better approach to handling multiple taxonomy filters in Loops and Logic?
  3. Do you have any suggestions on how to optimize or improve this setup?

Thanks in advance for any help or insight the community can provide!