• km

    (@kmaisch)


    Hi Ryan,

    Great plugin! I’m wondering if there is a way (perhaps using the custom meta queries) to automatically exclude child posts from the loop?

    I tried using post_parent = 0 – but I don’t think that’s a meta key.

    Alternatively (feature request), it would be great if there was an “Exclude Posts” option, similar to your “Include Posts” option.

    For now I’m using “Include Posts” and manually selecting the relevant ones – but being able to exclude the child posts will mean no need to update the query loop each time posts are added.

    Cheers,
    Kim

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Ryan Welcher

    (@welcher)

    This is a feature that has been requested and my only concern is that this can be a very expensive query to make and if used incorrectly has the potential to slow a site down or even crash it.

    Thread Starter km

    (@kmaisch)

    Thanks Ryan, what if it applied a class to the items in the loop, such as “is_child”, or “postid_123”. And then the exclude setting simply set display:none to those classes, depending on whether “Exclude children” or a “Hide posts from loop by ID” setting was used?

    (not sure if that would be less resource intensive?)

    Plugin Author Ryan Welcher

    (@welcher)

    The potential issue would occur at the point that we make the request from the database. Once we have the posts then the can be displayed normally. I may be overthinking the risk here but there are so many different server configurations out there that its very hard to know what the acceptable level of risk is to allow users to great even more expensive queries. That’s not a “No”, I just want to consider it

    All that being said, there is a pull request for this feature that I am reviewing currently

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Exclude child posts or specific posts’ is closed to new replies.