- This topic has 2 replies, 2 voices, and was last updated 5 years, 8 months ago by .
Viewing 3 posts – 1 through 3 (of 3 total)
Viewing 3 posts – 1 through 3 (of 3 total)
Posted
by
Forums › Forums › Search & Filter Pro › Exclude from SFP query in theme, not in CMS
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