Loop through recent posts from category of current in loop

Hi team,
i have built out a custom category loop to present children of a term. (https://staging.visitdargo.com.au/dargo-content/things-to-do/)
This works great.

Where i am stumbling is looping through the current items children to output recent posts from the current item (category)

I have been able to access the current item’s ID in the loop using {{dc:archive:id}} but when a looper provider is nested, only the active term ID is output.

What i am essentially trying to achieve is
Category X
Recent Post 1
Recent Post 2
Recent Post 3

Category Y
Recent Post 1
Recent Post 2
Recent Post 3

Hi @etheodore,

Thanks for reaching out.
I have tried in my local environment and achieved what you are trying to do. I would suggest you follow the below steps which I have done.

  1. Implement the All Terms type of Looper Provider to the Column named Category Loop.

test-new-Content-Pro - 2021-05-27T151152.357

test-new-Content-Pro - 2021-05-27T151249.406

  1. Added the Text element to show the Category Title using {{dc:term:name}}

  1. Added a div element and implemented the nested loop of Query String with the following Query

category_name={{dc:term:name}}&post_type=post&posts_per_page=3&offset=0&ignore_sticky_posts=1&post__not_in%5B0%5D={{dc:post:id}}

test-new-Content-Pro - 2021-05-27T151653.750

test-new-Content-Pro - 2021-05-27T151716.195

  1. Added a Text element to show the Post Title inside the Div element.

Hope it helps.
Thanks

1 Like

And this my friends, is the very reason i love developing using this Theme. Nesting that query string on a DIV in the loop with looper consumer activated provided the result required. Appreciate your assistance.

We are delighted to assist you with this.

Cheers!

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