Hi!
This is definitely possible! I would approach it this way:
<Loop field=archive_term><Set term_id><Field id /></Set></Loop>
<Loop type=project taxonomy=project_type terms="{Get term_id}" taxonomy_2=featured terms_2=featured orderby=date order=desc>
<div>
<a href="{Field url}">
<div class="fl-post-image">
<Field image size="large" />
</div>
<div class="fl-post-text">
<h2 style="margin-bottom: 0;"><a href="{Field url}"><Field title /></a></h2>
<p><Field sub_head /></p>
</div>
</a>
</div>
</Loop>
The rest of my response is just explanation, so you can just go ahead and copy-paste that code block and it should work ??
The Loop tag gets the archive context by default if you just write <Loop></Loop>
, but as soon as you add other attributes like your taxonomy filtering that context breaks down. So your instinct to open a project loop with terms=current was correct, however that doesn’t seem to work in my testing. (If you try it on your end again let me know if it works!)
Because the default Loop context on an archive is the posts in it, you need to open a separate loop to access the current term fields like title, ID and custom fields. You can use <Loop field=archive_term>
on archives for this purpose. Inside my archive_term loop I saved the term ID as a variable to pass to the main loop using Set and Get
The part you were getting wrong is that your nested loops are unnecessary, as you can use up to three taxonomy filters on a single Loop. You’ll find the taxonomy attributes for the post Loop documented here.
Aside from that, nested Loops only inherit context if you tell them to, so your example could maybe have worked if you passed include="{Field id}"
to the inside Loop (assuming the filter priorities work in the specific way we need them to, I haven’t actually tested it):
<Loop type=project count=1 taxonomy=project_type terms=current orderby=date order=desc >
<Loop type=project include="{Field id}" taxonomy=featured terms=featured>
<div>
<a href="{Field url}">
<div class="fl-post-image">
<Field image size="large" />
</div>
<div class="fl-post-text">
<h2 style="margin-bottom: 0;"><a href="{Field url}"><Field title /></a></h2>
<p><Field sub_head /></p>
</div>
</a>
</div>
</Loop>
</Loop>
Hope that helps!
Please visit our discussion forum if you have any other questions!