Related articles module (excluding a certain category)

Dear X Theme,
I have a related articles module with the condition

„{{dc:looper:field key=“id”}} is not {{dc:post:id}}

It basically blocks the same post to appear in the related article module which is set up by you (thanks again) and works great. How can I exclude a certain category? If it helps that category contains as blog format only links. Basically, I don’t want entries with external links to appear there.

Hi @burkiburak,

Thanks for reaching out!

It would be best if we could check your setup again, would you mind sharing your admin credentials? To do that, please give us the following information in a Secure Note.

  • WordPress Login URL
  • Admin level username and password
  • Layout Builder name or Page URL

You can find the Secure Note button at the bottom of your posts.

Cheers!

Sure Peter,
I provided you with the necessary info in a secure note.

What I’m aiming for is, to exclude all the post entries with the taxonomy "Presse“ in the related articles module. So we won’t be seeing in this module the same post as the post above and at the same time, we also won’t be seeing the “Presse” taxonomy (which are external links).

Hey @burkiburak,

Thanks for providing the details but unfortunately, you forgot to add the website URL. Would you mind adding the website URL in the secure note?

Cheers!

sorry, I just have updated the secure note.

Hi @burkiburak,

You need to use the Query String option of the Looper Provider and the category__not_in would the argument where you need to specify the category ids to exclude those. I would suggest you go through the following article which may help you on this.

Hope it helps.
Thanks

Dear @marc_a and @tristup
thanks for your help but I’m also a bit confused. I think it has been logged into the wordpress and the conditions have been changed.
Now I don’t see any more entries with the taxonomy “Presse”. Which is great.
but I see in the related articles module the same entry as above. (e.g. https://www.dezernatzukunft.org/ueberstuerzte-zinserhoehungen-treffen-vor-allem-die-jungen/)
I was trying to avoid both actually.

In the main "POSTS" row the conditions = {{dc:looper:field key=“id”}} is not {{dc:post:id}}
Looper provider: Current Post Terms > Tags

below that in "POST" the conditions =  {{dc:looper:field key=“id”}} is not {{dc:post:id}}
Looper provider: Query Strings > tag_name={{dc:term:name}}

So I see a modification but not the one proposed by @tristup. I would really appreciate getting the right syntax.

Hello @burkiburak,

Using the Looper Provider: Current Post Terms is incorrect. You should be using a Looper Provider: Query String. Please check out this thread as your guide:

Best Regards.

1 Like

Hey guys
Thanks for the tips. I managed to exclude that certain category setting up the looper provider in the nested post element like that (see the screenshot)
Bildschirmfoto 2022-02-14 um 16.22.22

But I’m still seeing the same post in the related articles module as above although I tried to embed
the following code many times.

{{dc:looper:field key=“id”} Is not {{dc:post:id}}

What am I doing wrong?

Hi @burkiburak,

You need to add the post__not_in attribute into the Query String and mention the {{dc:post:id}} to exclude the current post from the related post query. You need to add the following code into your Query String.

&post__not_in%5B0%5D={{dc:post:id}}

And your code will look like:

category__not_in=39&post__not_in%5B0%5D={{dc:post:id}}

Hope it helps.
Thanks

1 Like

Hello @tristup,

thanks, it worked like a charm. And thanks for your patience with me :slight_smile:

Have a great day

Hi @burkiburak,

Glad that we are able to help you.

Thanks

1 Like

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