Hi there.
The only way would be to use the alm_modify_query_args
filter.
See the link below.
https://connekthq.com/plugins/ajax-load-more/docs/filter-hooks/#alm_query_args
Hi, thanks for the reply.
I see and it’s working but, how can I work with conditionals there? I’m trying the code below but I need to change the values of “value” inside the array to something coming from the form.
I try to use the data from $_POST but doesn’t work.
Any clue about it?
Thanks again for the support!
function automondo_alm_modify_query_args( $args, $page ) {
// $args = current ajax load more $args
// $page = current page slug
if( $page === 'estoque' ) {
$args[ 'posts_per_page' ] = '6';
$args[ 'meta_query' ] = array(
array(
'key' => 'ano',
'value' => array( '2013', '2016' ),
'compare' => 'BETWEEN',
),
);
}
return $args;
}
I haven’t tried this filter with form variables.
I think you would need a helper function that fetches the form values.
Ill think some more about this over the weekend…