Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Darren Cooney

    (@dcooney)

    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

    Thread Starter Paulino Michelazzo

    (@pmichelazzo)

    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;
    }

    Plugin Author Darren Cooney

    (@dcooney)

    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…

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Is more than 4 meta query objects possible?’ is closed to new replies.