Dynamic taxonomy in query loop element
Hi,
I have created a service page template for different services. A service page contains a FAQ section, as well as the start page.
I created a custom type "FAQ". This FAQ type has several taxonomies. Each taxonomy represents a service.
I now used a query loop to display the related FAQ posts on my start page (with the taxonomy "general"). Now, I want to show the related FAQ posts on each service subpage depending on the taxonomy.
The issue being that I can only select one value in the taxonomy dropdown... There is a value called "Current" but I have no clue what it does. So inside the service template it seems I can't select the taxonomy based on some dynamic value, right?
I thought of a workaround (although it is not great) to just add all faqs with all taxonomies to the service template and hide them all and just show the one that is currently active. Wanted to use conditional logic, but again, I have no idea if and how that could be achieved. The options are so limited there.
Any idea how I could achieve the desired outcome?
Thanks and regards
Comments
Hi,
Please always attach a link to your website so we can check it out. If the page is offline(localhost), then our help will be limited. You will have to contact us when the page is online. Also, please make sure that the page is not under maintenance before you provide us with the link.
It is always a good idea to also attach a screenshot showing what you refer to.
Thanks
credentials and further details are sent via contact form.
Query Loop displays all categories in a dropdown for me:
I am sorry but I quite do not understand what your goal is exactly.
Did you watch our video tutorials about query loops and templates?
https://www.youtube.com/watch?v=maE0FuFIhjQ&list=PLyfUqkbtW2kxq8AY0SivMxX7kf2H9Y-Wf
https://support.muffingroup.com/video-tutorials/how-to-use-templates-a-step-by-step-guide/
Best regards
Hi Phil,
I'm sorry. With the dropdown everything is fine. I'm just wondering if there is a way to have the included taxonomy be dynamic. Currently I can only choose specific taxonomies via dropdown. But I'm using this FAQ section in a template page.
I created 7 custom posts that are representing the content for 7 service subpages. These subpages use the template page. Each service has its own taxonomy. The taxonomy defines the content of the FAQ section.
Example: On service page "Mixing" I want to show all FAQs related to Mixing. On service page "Live Recordings" I want to show all FAQs related to Live Recordings and so on.
If I choose taxonomy "Mixing" in the Query loop now, all service pages will show Mixing related FAQs.
So I'm searching for a way to solve this, without having to build pages for each service.
I hope I was able to make it more clear now. 😅
You have no template assigned to your FAQ post type archive:
Moreover, the one you have is not assigned to any condition, and the template itself is empty.
Please see the video about templates I sent in my previous message.
Thanks
Hi Phil,
I've seen the tutorial, but it doesn't help with my issue. I made a screencast. Please check it out, maybe this will clarify what my actual problem is 🙃
https://cln.sh/hsKw80Rw
Thanks for your patience.
Thanks for the clarification. It helped a lot.
Unfortunately, it will not work this way, as these two are different post types and they are not connected in any way. Current would work if you were in a FAQ post type, but as you are checking Services pages current does not work as it is different post type.
To do so, you would have to create a separate template for each service page.
Best regards