Exclude from SFP query in theme, not in CMS

Forums › Forums › Search & Filter Pro › Exclude from SFP query in theme, not in CMS

Viewing 3 posts – 1 through 3 (of 3 total)
  • Anonymous
    #274556

    Hi there,

    I’m looking to dynamically exclude post’s by ID in a particular template.

    I have this code:

    `
    $args = [
    ‘search_filter_id’ => $sfpform->id(),
    ];

    $news = new WP_Query($args);
    `

    I have tried this below, but it doesn’t work. The post__not_in value is not picked up.

    `
    $args = [
    ‘search_filter_id’ => $sfpform->id(),
    ‘post__not_in’ => [‘1511’],
    ];

    $news = new WP_Query($args);
    `

    Is it possible to hook into the query after search and filter has been added, but before the query is run, so that I can add extra overrides?

    Cheers,
    Jamie

    Anonymous
    #274557

    Apologies, I found the filter in the filter reference section. Thanks, and this ticket can be closed.

    Trevor
    #274587

    Thanks for letting me know. I will close this thread for now.

Viewing 3 posts – 1 through 3 (of 3 total)

Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.