• Hi there,

    I use WordPress Query Loop Block to display related posts at the end of a blog post, which posts have the same category as the current posts.

    The issue is the the current post will be displayed as well.

    So, how to exclude the current post from Query Loop Block? So that you can use this function as related posts?

    Best,

    Raido

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello, it looks like the following forum topic, Query Loop Block – how to exclude the current post?, addresses this same issue.

    Thread Starter raits515

    (@raits515)

    @artemiosans Yes, but that ticket is closed for new replies…

    I hope someone knows how to do that or can figure out a workaround

    • This reply was modified 2 years, 2 months ago by raits515.

    I took a look at the Query Loop Block myself and don’t see any options for excluding specific posts in the documentation, unfortunately.

    The best options to me seem to be:
    1.) Use a plugin
    2.) Write a custom query or block

    Potential workarounds could be:
    3.) Making the post in question sticky, and excluding sticky posts from the query
    4.) Using the offset option to skip the post in question

    Maybe these thoughts can help jog some ideas.

    Thread Starter raits515

    (@raits515)

    Yeah there’s no option, but I believe changing or adding something to the query loop code would make it possible.

    1) want to avoid extra plugins
    2) I’m just not that technical myself.

    3) The issue with the sticky post is that there are multiple posts in the category that would require related posts but using it would only work with 1 post. Because making them all sticky would remove them all – but great thought.

    4) I’ll have to research this one to see if its possible and, if yes, find how.

    • This reply was modified 2 years, 2 months ago by raits515.
    • This reply was modified 2 years, 2 months ago by raits515.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘how to exclude the current post from Query Loop Block?’ is closed to new replies.