• i am searching within a custom post type “music” and attachment

    i want to exclude a duplicate if the search matches the post and the attachment within the post

    basically if post->ID matches attachment post->post_parent

    one of them loads first…and should not allow the other

    is there any way to do this before get posts like in pre_get_posts

The topic ‘Exclude Attachments from loop if post_parent in loop’ is closed to new replies.