Forums › Forums › Search & Filter Pro › Custom WP Query & offset parameter
- This topic has 4 replies, 3 voices, and was last updated 1 year, 11 months ago by Anonymous.
-
Trevor(Private) October 27, 2020 at 2:52 pm #264256
Our plugin does not use wp_query in the normal way. Instead it passes a string of matching Post IDs using post__in, so anything you code in to a page’s wp_query arguments is likely to fail, as we ignore most of them, and some that you might add might break our plugin. As such, we do not support a post offset.
Anonymous(Private) October 27, 2020 at 3:10 pm #264258Appreciate the answer – any workaround you might think of? i thought just hiding the first item but then i get to a weird situation as i want to set 12 posts per page via your plugin.
look – https://forter2020.wpengine.com/blog/
Any suggestion?
Thanks,
RoeeAnonymous(Private) December 7, 2022 at 11:03 am #276695Why not use the Edit Query Arguments Filter?
https://searchandfilter.com/documentation/action-filter-reference/
/////////////////
function filter_function_name( $query_args, $sfid ) {
if($sfid==12345)
{
//modify $query_args here before returning it
//$query_args[‘somearg’] = ‘newvalue’;
$query_args[‘offset’] = ‘1’;
}
return $query_args;
}
add_filter( ‘sf_edit_query_args’, ‘filter_function_name’, 20, 2 ); -
AuthorPosts