I would like to display related articles, i.e. articles from the same category. Can I set this dynamically and add it to the post template? If so, how? I can’t find a setting in Looper to query my own category…
Hello @JanWae,
Thanks for writing to us.
You can use Looper and set the Looper provider as a query string, and you may use this query string to get the related posts.
category_name={{dc:term:slug}}&post_type=YOUR_POST_TYPE&posts_per_page=3&offset=0&ignore_sticky_posts=1&post__in%5B0%5D={{dc:post:id}}
Thanks
Hello @prakash_s,
thank you very much for the suggestion.
When I use the query like this:
category_name={{dc:term:slug}}&post_type=post&posts_per_page=3&offset=0&ignore_sticky_posts=1&post__in%5B0%5D={{dc:post:id}}
I get exactly one article. Namely, the current one that is also displayed. What am I doing wrong?
Hello @JanWae,
I am sorry for the confusion. I would suggest you please add this query string and recheck it.
category={{dc:term:slug}}&post_type=post&posts_per_page=3&offset=0&ignore_sticky_posts=1&post__not_in%5B0%5D={{dc:post:id}}
Hope it helps
Thanks
I think that’s a transmission error. There were still HEX characters in your query.
This seems to work:
category_name={{dc:term:slug}}&post_type=post&posts_per_page=3&offset=0&ignore_sticky_posts=1&post__not_in[0]={{dc:post:id}}
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.