Forums Forums Search & Filter Pro change the posts_per_page argument in WP Query

Viewing 8 posts - 1 through 8 (of 8 total)
  • Anonymous
    #120696

    Again I forgot ‘follow-up via email’ so I’m checking it here.

    Trevor
    #120702

    I guess you would need to use is_page() to detect which page you are on and make two forms for filtering, identical except for the number of posts.

    Anonymous
    #120734

    Thanks for the quick reply.
    But that would mean two different search forms. (one with posts_per_page = 9 and one with -1).
    But the search is done on the homepage and the results displayed on the ‘te-huur’ page. I just need those same results for two different ‘tabs’ so the same results with ‘9’ and ‘-1’, but for that i need to alter the search form argument that sets it to ‘9’. If that is possible.

    Anonymous
    #120736
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    	$args = array(
    		'order'=> 'ASC',
    		'orderby' => 'date',
    		'post_type' => 'panden', 
    		'posts_per_page' => 9,
    		'meta_key' => 'status',
    		'meta_value' => array('Te huur', 'Te huur onder reservatie'),
    	'paged' => $paged);
    	$args['search_filter_id'] = 71;
    	$pandenLoop = new WP_Query($args);
    

    I thought I would create a new WP_Query with those same arguments and just alter the ”posts_per_page’ => 9,’. But these are set in ‘$args[‘search_filter_id’] = 71;’ and I don’t know how to access those arguments.

    posts_per_page' => 9 has no effect here because it take that argument from $args['search_filter_id'] = 71;

    Trevor
    #120740

    I am not sure that we are understanding each other. Is a Skype voice session possible, so we can talk this thing through?

    Anonymous
    #120748
    This reply has been marked as private.
    Trevor
    #120750

    Yes, you can use get_field(). I have made many custom results.php templates for various ACF fields.

    Anonymous
    #120766
    This reply has been marked as private.
Viewing 8 posts - 1 through 8 (of 8 total)